Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor update #6

Merged
merged 4 commits into from
May 25, 2024
Merged

Minor update #6

merged 4 commits into from
May 25, 2024

Conversation

alexispurslane
Copy link
Owner

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, but gc-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:

Screenshot from 2024-05-24 21-38-38

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.

@alexispurslane alexispurslane merged commit 40df7e9 into main May 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant