I “live in Emacs”, like most of us (atleast at work). It has been getting slower release on release, async support doesn’t seem to have been picked up by most packages and native-comp has made it more brittle.
Over this time, we moved from running the OS on hardware to running in VMs, so fractional slowdown was expected. But what I have is a few X slower Emacs. I had never seen Emacs take a minute to indent a few thousand lines, for example. Maybe some modes have slower code.
Emacs doesn’t seem slower for me than in bygone years. If anything, recent versions are faster because of native Lisp compilation. But, some language modes did slow down a lot (while gaining generality) as they switched from custom parsers to LSP, tree-sitter, and so on. Maybe that’s what you’re seeing.
I did some comparisions. The installation built without treesitter support is noticeably faster than the one built with treesitter support; even in the latter, I don’t have any treesitter grammars at all and no -ts-mode in use.
I appreciate your frustration but several times slower is not normal, something is broken in the environment or setup. I’ve been using Emacs for decades and I would never put up with any kind of slowdown, not to mention several times slower. Yikes.
To make sure that I am not just talking out of my ass I ran elisp-benchmarks between emacs-28 from about 4 years ago and emacs-30. Every benchmark was either faster or unchanged with emacs-30 and overall it was almost twice as fast as emacs-28. Many of these benchmarks are compute heavy but the more interactive ones like elb-scroll and elb-smie were faster too.
I need a fast setup on the same hardware to compare against, but I don’t have it. This is the experience on VMs. I don’t know what is fast for people. I stated one of my observations that indenting a couple of thousand lines is slow. How fast is that for you, in a VM or on hardware?
I don’t have a VM based setup but on my aging laptop:
- Indenting a single line in a buffer with ~5K lines of code is instantaneous
- Indenting the entire 5K line buffer using
C-x h C-M-\
varies depending on the language and mode used. For elisp or fennel it’s instantaneous, for Go it’s about 1.5 second. - A slow case I’ve found was indenting a C or Go buffer where every line needed to be touched, this was about 7 seconds which is admittedly slower than I thought it would be
- Indenting such a file while in c-ts-mode (so with tree-sitter enabled) is about 1s.
- Same but using LSP and
M-x eglot-format-buffer
is instantaneous if a small number of fixes are required or about 1s if every line needs to be touched.
Thanks gor the numbers. They don’t make Emacs look unusable, so we could blame these darn cloud-provisioned VMs!
There’s probably something with with your installation or configuration. For me Emacs has always felt fast and has been getting faster, the biggest jump being of course the native compiler.
Time to reindent lines is something that tends to increase, as indentation quality is improved over the years (and as the need increases to support ever more syntactic features of the indented language).
But it really depends more on the text being indented and the mode in use than on the version of Emacs, IME.Thanks. True, verilog-mode is maybe 6 times slower than c+±mode. I should add some treesitter grammars and try c+±ts-mode etc.
File opening being slow must be a different aspect.
@tetrislife this is my biggest issue with emacs. It’s lags, and freezes, and occasionally hangs. Maybe it’s an emacs on macos thing, but this has been a recurring problem for me over the years with nothing really fixing it. It’s the emacs jank!
Everytime I use anything else (vim, vscode, zed, helix), I am blown away with the speed and responsiveness.
To be fair, Emacs handles large files better than Vim. But yes, Emacs is slower on typical tasks, to the extent that an Electron app like VSCode can feel more responsive. Some slowness could be acceptable due to Emacs’ flexibility, but getting slower over time messes up the experience.
post your config? or you mean stock/vanilla as in
emacs -q
?I don’t configure at all, Emacs is quite capable out of the box. But you are right that I should try with -Q. I tried and found things like, terminal versus GUI doesn’t make a difference, and disabling font-lock-mode makes it almost twice as fast (but I wouldn’t use Emacs that way).
My emacs is fast as fuck and I don’t even have native comp enabled. 300ish packages installed, with a very deep configuration. Fully loads in 0.8 seconds, never freezes.
Sounds like someone didn’t read the docs.
What hardware/VM and OS are you running on? What kind of development do you do in Emacs?
And, are you normalizing having to read the docs to have, for example, indent-region not be too slow?
I agree native-comp shouldn’t be necessary, since Emacs wasn’t this slow until maybe Emacs 25 and they keep improving the Elisp interpreter. And we probably can’t expect the speed from before the CPU vulnerability mitigations and from running on hardware from any software running in VMs nowadays.
What I see is much worse than that.
Instead of being a dick, how about quoting the relevant portion of the manual that makes your setup fast as fuck.