diff --git a/lisp/doom-start.el b/lisp/doom-start.el index 324d01efe..cde2d7cde 100644 --- a/lisp/doom-start.el +++ b/lisp/doom-start.el @@ -206,6 +206,14 @@ If RETURN-P, return the message as a string instead of displaying it." (doom-run-hook-on 'doom-first-file-hook '(find-file-hook dired-initial-position-hook)) (doom-run-hook-on 'doom-first-input-hook '(pre-command-hook)) +;; The GC introduces annoying pauses and stuttering into our Emacs experience, +;; so we use `gcmh' to stave off the GC while we're using Emacs, and provoke it +;; when it's idle. However, if the idle delay is too long, we run the risk of +;; runaway memory usage in busy sessions. If it's too low, then we may as well +;; not be using gcmh at all. +(setq gcmh-idle-delay 'auto ; default is 15s + gcmh-auto-idle-delay-factor 10 + gcmh-high-cons-threshold (* 16 1024 1024)) ; 16mb (add-hook 'doom-first-buffer-hook #'gcmh-mode) ;; There's a chance the user will later use package.el or straight in this diff --git a/lisp/doom.el b/lisp/doom.el index 3d19627ab..0eb7f91e3 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -396,15 +396,6 @@ Otherwise, `en/disable-command' (in novice.el.gz) is hardcoded to write them to ;; fonts that are larger than the system default (which would resize the frame). (setq frame-inhibit-implied-resize t) -;; The GC introduces annoying pauses and stuttering into our Emacs experience, -;; so we use `gcmh' to stave off the GC while we're using Emacs, and provoke it -;; when it's idle. However, if the idle delay is too long, we run the risk of -;; runaway memory usage in busy sessions. If it's too low, then we may as well -;; not be using gcmh at all. -(setq gcmh-idle-delay 'auto ; default is 15s - gcmh-auto-idle-delay-factor 10 - gcmh-high-cons-threshold (* 16 1024 1024)) ; 16mb - ;; Emacs "updates" its ui more often than it needs to, so slow it down slightly (setq idle-update-delay 1.0) ; default is 0.5