From 0db93d846d3a19b8ac5425b5f1a8d9055b69013f Mon Sep 17 00:00:00 2001 From: noa Date: Tue, 17 Sep 2024 10:20:38 +0800 Subject: Start using gcmh --- emacs/init.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'emacs') 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") -- cgit 1.4.1-2-gfad0