summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--config.org27
1 files changed, 26 insertions, 1 deletions
diff --git a/config.org b/config.org index b23420f..180d009 100644 --- a/config.org +++ b/config.org
@@ -1299,7 +1299,7 @@ the user is looking at something else.
1299 1299
1300** Garbage collection 1300** Garbage collection
1301 1301
1302*** Garbage Collection Magic Hack :package: 1302*** COMMENT Garbage Collection Magic Hack :package:
1303 1303
1304Look, I'm not going to look too deeply into this. It's /magic/ afer 1304Look, I'm not going to look too deeply into this. It's /magic/ afer
1305all. 1305all.
@@ -1313,6 +1313,31 @@ all.
1313 (blackout 'gcmh-mode) 1313 (blackout 'gcmh-mode)
1314#+end_src 1314#+end_src
1315 1315
1316*** Simple GC munging about
1317
1318From [[https://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/][bling]], from ... 2016? Maybe this isn't great, but it's one less package so
1319I'm going to try it for now.
1320
1321#+begin_src emacs-lisp :noweb-ref hooks
1322 (defconst gc-cons-basis (* 800 1000)
1323 "The basis value to which to return after a max jump.
1324
1325 800,000 (800 KB) is Emacs' default.")
1326
1327 (defun hook--gc-cons-maximize ()
1328 "Set `gc-cons-threshold' to the highest possible.
1329 For memory-intensive features."
1330 (setq gc-cons-threshold most-positive-fixnum))
1331
1332 (defun hook--gc-cons-baseline ()
1333 "Return `gc-cons-threshold' to `gc-cons-basis'.
1334 For after memory intensive operations."
1335 (setq gc-cons-threshold gc-cons-basis))
1336
1337 (add-hook 'minibuffer-setup-hook #'hook--gc-cons-maximize)
1338 (add-hook 'minibuffer-exit-hook #'hook--gc-cons-baseline)
1339#+end_src
1340
1316*** Garbage Collect when out of focus 1341*** Garbage Collect when out of focus
1317 1342
1318#+begin_src emacs-lisp :noweb-ref hooks 1343#+begin_src emacs-lisp :noweb-ref hooks