all repos — nixfiles @ 8f47d540ce6b1b56aebfa427e9f7d2d7e44e9bb4

System and user configuration, managed by nix and home-manager

Emacs: collect gc stats for a while
Alan Pearce alan@alanpearce.eu
Wed, 21 Jun 2023 12:58:07 +0200
commit

8f47d540ce6b1b56aebfa427e9f7d2d7e44e9bb4

parent

77f8d0771b0bd36dcbca9e61fc88ba9dc7d7b4b9

2 files changed, 7 insertions(+), 11 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -1,17 +1,7 @@ ;;; init --- user init file  -*- lexical-binding: t; -*-
 (eval '(setq inhibit-startup-echo-area-message "alan"))
 (defvar default-file-name-handler-alist file-name-handler-alist)
-(setq gc-cons-threshold most-positive-fixnum
-      gc-cons-percentage 0.6
-      file-name-handler-alist nil)
-(defun set-max-gc-cons ()
-  (setq gc-cons-threshold most-positive-fixnum))
-(defun set-default-gc-cons ()
-  (setq gc-cons-threshold (* 16 1024 1024)
-        gc-cons-percentage 0.1))
-(add-hook 'minibuffer-setup-hook #'set-max-gc-cons)
-(add-hook 'minibuffer-exit-hook #'set-default-gc-cons)
-(add-hook 'after-init-hook #'set-default-gc-cons)
+(setq file-name-handler-alist nil)
 
 (defun restore-file-name-handler-alist ()
   (setq file-name-handler-alist default-file-name-handler-alist))
@@ -54,6 +44,11 @@ :config (progn             (general-override-mode +1)
             (when (eq system-type 'darwin)
               (general-unbind "s-x"))))
+
+(use-package emacs-gc-stats
+  :config (progn
+            (setq emacs-gc-stats-gc-defaults 'emacs-defaults)
+            (emacs-gc-stats-mode +1)))
 
 ;;; Styles
 
M user/settings/emacs.nixuser/settings/emacs.nix
@@ -122,6 +122,7 @@ envrc         editorconfig
         eglot
         eldoc-box
+        emacs-gc-stats
         esh-buf-stack
         esh-help
         eshell-fringe-status