3 ms·
This deviates outrageously from my experience. The figures you’re giving are so extremely anomalous that there must be some simple explanation. Are you running
by chrismorgan 6y ago
This deviates outrageously from my experience. The figures you’re giving are so extremely anomalous that there must be some simple explanation.
Are you running WSL 1 or WSL 2? Is this emacs in a terminal, or GUI emacs via VcXsrv or similar? Where is the file, on the Windows side or the Linux side? How is emacs configured for, I dunno, swap files or whatever its equivalent is (I’m a Vim man)?
My first guess is that you’re using WSL 1 and accessing Linux files, and that emacs is doing synchronous flushing writes of some kind of swap file on the same file system after every tiny thing. If this is correct, I scream in horror at the magnitude of the wrongness of what emacs must be doing.
My second guess is that you’re running emacs in Windows’ conhost, and it’s emitting vast amounts of data to the terminal for whatever reason. conhost is really slow, though it’s getting a bit better.
If neither of these is correct, I’d be interested to know what is going on. Profiling may well make the answer obvious, though if you’re on WSL 1 I’m not sure if the standard profiling tools will work. If you’re on WSL 1, upgrade to WSL 2, it’s superior and faster in all regards except performance of accessing Windows files, which is way slower (but accessing Linux files is enormously faster). I’m convinced that there will be a simple explanation.
- daly 6y agoWSL1 editing a local file. Start WSL, type 'emacs -nw file' I have no idea what 'conhost' is so I can't comment.
- chrismorgan 6y agoconhost is Windows’ console host. If you’re running it in Command Prompt or equivalent, you’re running it in conhost. -nw means that you are running it inside a terminal emulator, which will be conhost unless you know you’re using a different terminal like the new Windows Terminal or Alacritty. This is very likely to be the problem—emacs is probably emitting large amounts of text (megabytes) to the terminal emulator with inefficient screen updates, and conhost is agonisingly slow. To be clear, I expect that Emacs is still substantially at fault here, because it sounds like it’s updating the screen in an extremely inefficient way that just happens to work well enough on Linux’s faster terminal emulators. Switching to a different terminal emulator that uses the new ConPTY interface, such as Alacritty or Windows Terminal, should speed things up a lot. But it’ll still be a good deal slower than the likes of xterm and urxvt and Alacritty on non-Windows platforms because ConPTY is still a substantial performance bottleneck. Various actions that are likely to help: • Upgrade to WSL 2. • Switch to a ConPTY-based terminal emulator like Windows Terminal or Alacritty. • Run Emacs in GUI mode via VcXsrv. (Sadly this isn’t quite as easy in WSL 2 because your $DISPLAY needs to include the IP address and VcXsrv needs to be told the IP address. In WSL 1, `DISPLAY=:0` would do it.)