diff options
author | noa | 2024-09-17 10:20:38 +0800 |
---|---|---|
committer | noa | 2024-09-17 10:20:38 +0800 |
commit | 0db93d846d3a19b8ac5425b5f1a8d9055b69013f (patch) | |
tree | 73438a79087e00c2c556a6b2d6fac6caebd78354 | |
parent | 652d20e78d1156b352ec6a6b9c93aaaa91699a28 (diff) |
Start using gcmh
-rw-r--r-- | emacs/init.el | 18 |
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") |