From ef61ce1e37be92785284efb2e304c38b29d34b88 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 28 Jan 2025 13:18:08 -0800 Subject: [PATCH] Change garbage collection settings While I don't mind Emacs taking more memory now, I figured I wouldn't do any garbage collection during start, and then drop down to a nice level after. --- bootstrap.org | 13 +++++++++++++ ha-org-literate.org | 4 ++-- initialize | 18 +++++++++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/bootstrap.org b/bootstrap.org index 3881974..27f6a1b 100644 --- a/bootstrap.org +++ b/bootstrap.org @@ -32,6 +32,19 @@ I'm installing everything using the [[https://github.com/raxod502/straight.el#ge See the details in [[https://dev.to/jkreeftmeijer/emacs-package-management-with-straight-el-and-use-package-3oc8][this essay]]. * Initial Settings +** Garbage Collection Settings +GC has always been a contentious subject in Emacs. Lot less of an issue now, but let’s not slow the startup (any more than I already do by checking all the packages to see if anything new needs to be downloaded). + +Limit garbage collection before startup and then go back to the default value (8 MiB) after startup. + +#+BEGIN_SRC emacs-lisp + (setq gc-cons-threshold most-positive-fixnum) + + (add-hook 'emacs-startup-hook + (lambda () + (setq gc-cons-threshold (* 100 1024 1024)))) +#+END_SRC + ** OS Path and Native Compilation Helper functions to allow code for specific operating systems: #+begin_src emacs-lisp diff --git a/ha-org-literate.org b/ha-org-literate.org index 801bacc..fa5dea2 100644 --- a/ha-org-literate.org +++ b/ha-org-literate.org @@ -2,7 +2,7 @@ #+author: Howard Abrams #+date: 2024-07-07 #+filetags: emacs hamacs -#+lastmod: [2024-11-11 Mon] +#+lastmod: [2025-01-28 Tue] A literate programming file for literate programming in Emacs Org Files. @@ -578,7 +578,7 @@ At this point, we can jump to functions and variables that I define in my org fi I can jump around my literate code as if they were =.el= files. I may want to think about expanding the definitions to figure out the language of the destination. ** Noweb References -A noweb definition, e.g. =<>= should /jump/ to the =#name= definition. +A noweb definition, e.g. =<>= should /jump/ to the =#name= definition. Since [[https://github.com/BurntSushi/ripgrep][ripgrep]] is pretty fast, I’ll call it instead of attempting to build a [[https://stackoverflow.com/questions/41933837/understanding-the-ctags-file-format][CTAGS]] table. Oooh, the =rg= takes a =—json= option, which makes it easier to parse. diff --git a/initialize b/initialize index b4e1375..b04a962 100755 --- a/initialize +++ b/initialize @@ -31,6 +31,9 @@ cat > "$HAMACS_DEST/early-init.el" < "$HAMACS_DEST/init.el" <