From 68fc323efd37eb1752c10ffe6fa1ddd86cdf2e6b Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Wed, 8 Jan 2025 13:02:34 +0000 Subject: [PATCH] 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. --- config.org | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/config.org b/config.org index e0459f4..ccfed9c 100644 --- a/config.org +++ b/config.org @@ -2,6 +2,17 @@ #+AUTHOR: Camden Dixie O'Brien #+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 Hey, customize, leave my ~/.emacs.d/init.el alone! @@ -1667,12 +1678,10 @@ (setq god-exempt-predicates nil) #+end_src -* Fin - Now that start-up is finished, [[help:gc-cons-threshold][gc-cons-threshold]] and - [[help:gc-cons-percentage][gc-cons-percentage]] need to be set back to reasonable values to avoid - memory usage getting too high. +* Coda + Now that initialization is finished, [[help:gc-cons-threshold][gc-cons-threshold]] should be set + back to its default value: #+begin_src emacs-lisp - (setq gc-cons-threshold 1000000) - (setq gc-cons-percentage 0.2) + (setq gc-cons-threshold original-gc-cons-threshold) #+end_src