aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/init.el
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2022-09-14 00:40:14 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2022-09-14 00:47:16 +0100
commita68e59b1b5e77d11266430304f1da31a915a82d5 (patch)
tree8a1d5413e061e07860b8e0b5f5dd21261d6cd130 /Emacs/.config/emacs/init.el
parent61f06ef0c86ce078489ed16274df459cf5f40d14 (diff)
downloaddotfiles-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/emacs/init.el')
-rw-r--r--Emacs/.config/emacs/init.el9
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