Fix faster startup time

The gc-cons-threshold wasn't reset! I think this caused some lag, due to long
gc breaks.
This commit is contained in:
larstvei 2024-03-22 20:31:22 +01:00
parent d6e1d07dab
commit 3d81cb5162

View File

@ -158,14 +158,17 @@
#+end_src
** Faster startup
A common optimization is to temporarily disable garbage collection during
initialization. Here, we set the ~gc-cons-threshold~ to a ridiculously large
number, and restore the default value after initialization.
#+begin_src emacs-lisp :tangle early-init.el
(setq gc-cons-threshold (* 100 1024 1024))
(setq gc-cons-threshold most-positive-fixnum)
(add-hook 'after-init-hook
(lambda ()
(setq gc-cons-threshold (* 1024 1024 20))))
#+end_src
* Packages