by MereInterest · 3y ago · 0 comments
I wanted to query the LSP server to tell whether the point was currently located within a string, but as far as I could tell, the LSP server couldn't be queried for the syntax type. You can ask for "selection suggestions", you can ask for "semantic tokens" within a specific range, but you cannot ask for the semantic token containing a single specific point.
Emacs can achieve much more performant editing with the same server, so there’s no excuse for VS Code to be so slow.
If you invested the time to configure Emacs to mimic VS code's completion- instantaneous fuzzy autocompletion on every keystroke- the GUI would lock up every time autocompletion is engaged, i.e. the entire editor stutters on every keystroke, because the garbage collector is constantly blocking the UI thread. The performance limitations are widely known. It's the reason yyoncho, the creator of LSP-mode, forked Emacs to explore adding multithreading to address the issue [0].
But I can't see this being fixed anytime soon, because there are a fleet of intellectually dishonest zealots on the internet that refuse to acknowledge it's an issue, and will flame anyone who brings it up.
As a result, when new users try out Emacs and see that the performance sucks, many of them will instantly uninstall and return to VS code, and the userbase suffers.
[0] https://www.reddit.com/r/emacs/comments/ymrkyn/async_nonbloc...
"easily verifiable"?!!? This is a ridiculous statement - lots of VSCode responsiveness is dependent on which language servers you're using, and some are definitely faster than others. Sounds like you're extrapolating from the languages that you personally use?
The golang LSP has had widely documented performance problems on large codebases on and off over the past 2ish years (mostly resolved at the moment AFAIK), but it was severe enough that a large percentage of my group at work switched to Goland (Go IDE from Jetbrains) because it was much, much less laggy on our larger projects than VSCode.
I am using lsp-mode enhanced autocompletion (using company.el) and I have never observed such a problem. I set the autcompletion delay to 0.0 in my case and work on 1k LOC modules.
If you enjoy VS code, I am glad for you. It is certainly a good editor. But don't post generalized slurs against Emacs if you obviously haven't used it for long.
Performance issues can happen but that highly depends on the context. What combination of language server, language server client and what language is causing this?
Edit:
If you are new to "lsp-mode" and you have performance issues, take a look here:
https://emacs-lsp.github.io/lsp-mode/page/performance/#json-...
Also consider trying other LSP servers if available. For popular languages there are usually several alternatives to choose from: