3 ms·
Emacs is my daily driver, and even with JIT on an M1 mac I get a lot of stutter and freezes with LSP autocomplete. JIT definitely improved things [especially
by SirensOfTitan 4y ago
Emacs is my daily driver, and even with JIT on an M1 mac I get a lot of stutter and freezes with LSP autocomplete. JIT definitely improved things [especially on my x86 machine], but I'm still unhappy with the slowness. Outside of LSP it's incredibly speedy.
- Barrin92 4y agoI had the same issues with LSP and I switched to eglot and it's much less sluggish for me. I don't know why that is or if it's a general solution but worth giving a shot as eglot is built in I think in the newer versions.
- trissylegs 4y agoIts because Emacs doesn't really have a way of performing asynchronous io. So lsp ends up blocking on the external server waiting for a reply. It been the main pain point for addung smarter autocomplete for years now.
- gpderetta 4y agoEmacs does have the ability to do non-blocking io though. Not sure if lsp-mode uses it and if not, why not.
- unhammer 4y agoIt actually does; support for async io has been there for ages. If you've ever compiled or run git push or run an external command like M-! sleep 10 & RET from Emacs, that's using async io. For things that end up calling an external command like that, the code will typically use `start-process` or `make-process`. For network io, there is `url-retrieve` with callbacks. For tasks that need to be run via emacs-lisp (e.g. sending emails, compiling elisp), there is John Wiegley's `async` library. However, lots of packages simply don't use these affordances. Also, for LSP, there's additional challenges since lots of json needs parsing for each request, but IIUC Emacs can't currently process the messages to/from the server while the UI thread is busy (the LSP server can do lots of work while UI is busy, but the communication is stalled until UI is done). Though it seems things will be improving there, hopefully this'll get upstreamed soon: https://www.reddit.com/r/emacs/comments/ymrkyn/async_nonblocking_jsonrpc_or_lsp_performance/ https://www.reddit.com/r/emacs/comments/ymrkyn/async_nonbloc...