summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authornoa2024-09-17 10:20:38 +0800
committernoa2024-09-17 10:20:38 +0800
commit0db93d846d3a19b8ac5425b5f1a8d9055b69013f (patch)
tree73438a79087e00c2c556a6b2d6fac6caebd78354 /emacs
parent652d20e78d1156b352ec6a6b9c93aaaa91699a28 (diff)
Start using gcmh
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/emacs/init.el b/emacs/init.el
index e6e03bb..2e38ee6 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -7,17 +7,17 @@
 
 (add-to-list 'load-path (expand-file-name (concat user-emacs-directory "site-lisp")))
 
-;; I like to see garbage collection messages.  I keep meaning to set up something like the [[https://akrl.sdf.org/#orgc9536b4][garbage collector magic hack]] so that emacs hangs less when i'm running a macro or opening a big web page or whatever.  But for now, the default values are adequate.
-(setq garbage-collection-messages t)
-
-;; We set the ~gc-cons-threshold~ and ~gc-cons-percentage~ to be really high in the ~early-init.el~ file.  This makes loading emacs a little bit faster.  But obviously i don't want that in general usage, so once emacs has finished starting up, i make sure to lower the values again.
+;; Give me stats on garbage collection and startup time
+(setopt garbage-collection-messages t)
 (add-hook 'emacs-startup-hook
 	  #'(lambda ()
-	      (message (format "Initialised in %s seconds with %s garbage collections." (emacs-init-time) gcs-done))
-		  ;;; reset garbage collector
-	      (setq
-	       gc-cons-threshold 800000
-	       gc-cons-percentage 0.2)))
+	      (message (format "Initialised in %s seconds with %s garbage collections." (emacs-init-time) gcs-done))))
+
+;; Use the gcmh to collect garbage when i'm not using emacs
+(use-package gcmh
+  :ensure t
+  :custom
+  (gcmh-mode t))
 
 (setopt user-full-name "noa")
 (setopt user-mail-address "noa@noa.pub")