diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2022-09-14 00:40:14 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2022-09-14 00:47:16 +0100 |
commit | a68e59b1b5e77d11266430304f1da31a915a82d5 (patch) | |
tree | 8a1d5413e061e07860b8e0b5f5dd21261d6cd130 /Emacs/.config | |
parent | 61f06ef0c86ce078489ed16274df459cf5f40d14 (diff) | |
download | dotfiles-a68e59b1b5e77d11266430304f1da31a915a82d5.tar.gz dotfiles-a68e59b1b5e77d11266430304f1da31a915a82d5.tar.bz2 dotfiles-a68e59b1b5e77d11266430304f1da31a915a82d5.zip |
(Emacs)+recursive powers of 1024 to set gc-threshold
Nice function, deterministic, uses a minimal amount of time to compute.
Diffstat (limited to 'Emacs/.config')
-rw-r--r-- | Emacs/.config/emacs/init.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Emacs/.config/emacs/init.el b/Emacs/.config/emacs/init.el index 46facd4..f735977 100644 --- a/Emacs/.config/emacs/init.el +++ b/Emacs/.config/emacs/init.el @@ -101,7 +101,14 @@ (require 'org) (require 'eglot)) -(setq gc-cons-threshold 100000000) +(defun --powers-of-1024 (n start) + (if (= n 0) + start + (--powers-of-1024 (- n 1) (* 1024 start)))) + +(let ((mebibyte (--powers-of-1024 2 1))) + (setq gc-cons-threshold (* 100 membibyte) ; ~100MiB + read-process-output-max (* 5 mebibyte))) ; ~5MiB (provide 'init) ;;; init.el ends here |