From 6bd9c7c8803f198575e8a676a9586ea4c496bfa3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 9 Oct 2021 17:13:54 +0200 Subject: [PATCH] perf: run GC a little less aggressively The delay will not be adjusted on a per-GC basis, depending on its last run-time. This should average to around 2-3s, which should be a good compromise between GCing too often and too infrequently. --- core/core.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/core.el b/core/core.el index b23d3ce0a..0be2bcfec 100644 --- a/core/core.el +++ b/core/core.el @@ -310,10 +310,12 @@ config.el instead." ;; 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. -(setq gcmh-idle-delay 0.5 ; default is 15s - gcmh-high-cons-threshold (* 16 1024 1024) ; 16mb - gcmh-verbose doom-debug-p) +;; 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