Skip to content

Instantly share code, notes, and snippets.

@kebairia
Created June 20, 2021 15:21
Show Gist options
  • Save kebairia/49d68227a5f86e4b0dfc8c5dd2e05909 to your computer and use it in GitHub Desktop.
Save kebairia/49d68227a5f86e4b0dfc8c5dd2e05909 to your computer and use it in GitHub Desktop.
Faster Startup for your Emacs
;; gc-cons-threshold is the number of bytes of consing before a garbage collection is invoked. It’s normally set at 800,000 bytes, but for me that invokes the GC 39 times!!! during startup (gcs-done) , and the GC is sloooow. I’ve set it to ~384M above. And now no GC invocations during startup. source: 2 easy little known steps to speed up Emacs start up time
;; reset the gc-cons-threshold to its defaults values after startup
;; **Faster Startup**
;; Speed up startup
(setq gc-cons-threshold 402653184
gc-cons-percentage 0.6)
(add-hook 'after-init-hook
`(lambda ()
(setq gc-cons-threshold 800000
gc-cons-percentage 0.1)
(garbage-collect)) t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment