Setup
Windows 10 host with X server (VcXsrv)
Linux guest (Arch) in virtual machine (VMware)
Benchmark
(defmacro measure-time (&rest body)
"Measure the time it takes to evaluate BODY."
`(let ((time (current-time)))
,@body
(message "%.06f" (float-time (time-since time)))))
(measure-time (byte-recompile-directory package-user-dir nil 'force))
Results
Total of 285 files compiled, 22 skipped in 16 directories
Native Emacs on Windows: 11.5 sec
emacs -nw
in Linux virtual machine: 5.1 secEmacs in Linux virtual machine, displayed in X on the same machine (
startx
): 31.9 secEmacs in Linux virtual machine, displayed in X server on Windows:
33.6 sec (X11 forwarding via PuTTY SSH, uncompressed)
32.5 sec (direct access from virtual machine to X server port 6000 on host via VMware host only networking / Windows firewall disabled)
Question
Is it normal that Emacs on X is that much slower than emacs -nw
? In any case, what may be the cause for the slowness?
At first I only tested 4, and I was thinking that there is some network overhead between Linux and Windows which is causing the problem. Now I see that even with X on the same virtual machine (result number 3) slowness is an issue.
Only explanation for me is that the status messages in the mini buffer cause too much network traffic. To test that it would be interesting to completely disable the minibuffer, which I don't think is possible.
More benchmarks
For completeness, as I just have all that installed:
emacs -nw
in WSL (Ubuntu):Defender on: 10.3 sec
Defender off: 6.1 sec
Emacs in WSL, displayed in X server on Windows:
Defender on: 44.4 sec
Defender off: 36.3 sec
emacs -nw
in Mingw-w64: 9.7 secEmacs in Mingw-w64, displayed in X server on Windows: 17.4 sec
Version details
Native Emacs on Windows:
GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30
Emacs in Linux virtual machine:
GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-07-05
Emacs in WSL:
GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-05-29
Emacs in Mingw-w64:
GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30