Defer garbage collection in the minibuffer
This can speed up things that run in or from the minibuffer, like projectile/helm/ivy commands.
This commit is contained in:
parent
a581b7fc3f
commit
daef19ba64
1 changed files with 8 additions and 0 deletions
|
@ -298,6 +298,14 @@ original value of `symbol-file'."
|
||||||
;; Truly silence startup message
|
;; Truly silence startup message
|
||||||
(fset #'display-startup-echo-area-message #'ignore)
|
(fset #'display-startup-echo-area-message #'ignore)
|
||||||
|
|
||||||
|
;; Don't garbage collect to speed up minibuffer commands
|
||||||
|
(defun doom|defer-garbage-collection ()
|
||||||
|
(setq gc-cons-threshold most-positive-fixnum))
|
||||||
|
(defun doom|restore-garbage-collection ()
|
||||||
|
(setq gc-cons-threshold doom-gc-cons-threshold))
|
||||||
|
(add-hook 'minibuffer-setup-hook #'doom|defer-garbage-collection)
|
||||||
|
(add-hook 'minibuffer-exit-hook #'doom|restore-garbage-collection)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Bootstrap helpers
|
;; Bootstrap helpers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue