From fae47fc448b7b5f50e5a899ce6f876d7ef9a6d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Wed, 19 Sep 2018 00:25:17 +0100 Subject: [PATCH] Emacs27+: reduce number of GCs on startup from 4 to 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Edwin Török --- early-init.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/early-init.el b/early-init.el index c2c4a4a91..8beec8fb5 100644 --- a/early-init.el +++ b/early-init.el @@ -3,6 +3,12 @@ ;; Emacs HEAD (27+) introduces early-init.el, which is run before init.el, ;; before package and UI initialization happens. + +(defconst doom-gc-cons-upper-limit 268435456 ; 256mb + "The temporary value for `gc-cons-threshold' to defer it.") +;; This reduces gcs-done from 4 to 1 on startup +(setq gc-cons-threshold doom-gc-cons-upper-limit) + ;; Package initialize occurs automatically, before `user-init-file' is ;; loaded, but after `early-init-file'. Doom handles package ;; initialization, so we must prevent Emacs from doing it early!