Speed up bin/doom by staving off GC

This effectively halves the runtime of 'doom sync' and 'doom doctor',
and shaves 5-10% off other commands.
This commit is contained in:
Henrik Lissner 2020-05-27 02:55:14 -04:00
parent 7ed96590e6
commit ba817cb1ff
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -11,6 +11,11 @@
:; [ -x "$_DOOMPOST" ] && PATH="$_DOOMBASE/bin:$PATH" "$_DOOMPOST" "$0" "$@"
:; exit $CODE
;; CLI ops tend to eat a lot of memory. To speed it up, stave off the GC, but
;; not to `most-positive-fixnum' like we do in init.el; that's too high -- we
;; don't want to intentionally leak memory.
(setq gc-cons-threshold 134217728) ; 128mb
(let* ((loaddir (file-name-directory (file-truename load-file-name)))
(emacsdir (getenv "EMACSDIR"))
(user-emacs-directory