Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
The big win for this update is massively improved responsiveness and start times. I did a quick profile of Emacs's cpu usage while doing Eglot/corfu autocompletions, and it turned out 33% of the cpu time was being spent on garbage collection! Moreover, my start times had been steadily creeping up just past my target goal of 0.6s startup. So I went digging, and found out that according to the maintainers, the better variable to tweak isn't
gc-cons-threshold
, butgc-cons-percentage
. According to one, the recommended value is "0.2 or so", so I set it to 0.2 and....Holy smokes.
The entire UI was smoother and faster. Org mode opened noticeably faster. Files in general opened and font-locked faster. All of that could be dismissed as placebo, except the percentage of CPU time used up during a short completion session went from 33% to less than 3%, and that's 30% more time for Eglot during that window while it's doing completions. And if that isn't enough for you, start times went from 0.59-0.64 to 0.5-0.55. Seriously.
Just for good measure, I also upped
gc-cons-threshold
from 8MB to 100MB, also in accordance with maintainer recommendations, and my start times went from 0.5-0.55 to 0.45-0.52 or so. A fair enough gain, if less substantial. The UI feels a bit snappier too.In case you don't believe me, here's just a random startup I did right now, no prep:
And the best part is, Emacs actually isn't using basically any more memory than it did before. It uses about 85MB idling on the dashboard for me, and about 160MB with a project open and LSP running.