Set GC threshold high at start of initialisation

I did have this in here before and the code to set it back was still
at the end of the file, so not sure what happened there.  I guess I
accidentally removed it at some point.
This commit is contained in:
Camden Dixie O'Brien 2025-01-08 13:02:34 +00:00
parent 1f7d38e03f
commit 68fc323efd

View File

@ -2,6 +2,17 @@
#+AUTHOR: Camden Dixie O'Brien #+AUTHOR: Camden Dixie O'Brien
#+ATTR_LATEX: :float t #+ATTR_LATEX: :float t
* Prelude
Before doing anything else, set a higher [[help:gc-cons-threshold][gc-cons-threshold]] (I'm
using 100 MiB here) so that we're not garbage collecting during
initialisation to make startup a little faster. We'll save the
original value to restore it at the end of initialisation.
#+begin_src emacs-lisp
(setq original-gc-cons-threshold gc-cons-threshold)
(setq gc-cons-threshold (* 100 1024 1024))
#+end_src
* Customize * Customize
Hey, customize, leave my ~/.emacs.d/init.el alone! Hey, customize, leave my ~/.emacs.d/init.el alone!
@ -1667,12 +1678,10 @@
(setq god-exempt-predicates nil) (setq god-exempt-predicates nil)
#+end_src #+end_src
* Fin * Coda
Now that start-up is finished, [[help:gc-cons-threshold][gc-cons-threshold]] and Now that initialization is finished, [[help:gc-cons-threshold][gc-cons-threshold]] should be set
[[help:gc-cons-percentage][gc-cons-percentage]] need to be set back to reasonable values to avoid back to its default value:
memory usage getting too high.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq gc-cons-threshold 1000000) (setq gc-cons-threshold original-gc-cons-threshold)
(setq gc-cons-percentage 0.2)
#+end_src #+end_src