Emacs27+: reduce number of GCs on startup from 4 to 1

Signed-off-by: Edwin Török <edwin@etorok.net>
This commit is contained in:
Edwin Török 2018-09-19 00:25:17 +01:00
parent f25a5942e8
commit fae47fc448

View file

@ -3,6 +3,12 @@
;; Emacs HEAD (27+) introduces early-init.el, which is run before init.el, ;; Emacs HEAD (27+) introduces early-init.el, which is run before init.el,
;; before package and UI initialization happens. ;; 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 ;; Package initialize occurs automatically, before `user-init-file' is
;; loaded, but after `early-init-file'. Doom handles package ;; loaded, but after `early-init-file'. Doom handles package
;; initialization, so we must prevent Emacs from doing it early! ;; initialization, so we must prevent Emacs from doing it early!