(Emacs)+recursive powers of 1024 to set gc-threshold
Nice function, deterministic, uses a minimal amount of time to compute.
This commit is contained in:
@@ -101,7 +101,14 @@
|
|||||||
(require 'org)
|
(require 'org)
|
||||||
(require 'eglot))
|
(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)
|
(provide 'init)
|
||||||
;;; init.el ends here
|
;;; init.el ends here
|
||||||
|
|||||||
Reference in New Issue
Block a user