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.
This commit is contained in:
Howard Abrams 2025-01-28 13:18:08 -08:00
parent fcb1fdb11d
commit ef61ce1e37
3 changed files with 32 additions and 3 deletions

View file

@ -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]]. See the details in [[https://dev.to/jkreeftmeijer/emacs-package-management-with-straight-el-and-use-package-3oc8][this essay]].
* Initial Settings * Initial Settings
** Garbage Collection Settings
GC has always been a contentious subject in Emacs. Lot less of an issue now, but lets 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 ** OS Path and Native Compilation
Helper functions to allow code for specific operating systems: Helper functions to allow code for specific operating systems:
#+begin_src emacs-lisp #+begin_src emacs-lisp

View file

@ -2,7 +2,7 @@
#+author: Howard Abrams #+author: Howard Abrams
#+date: 2024-07-07 #+date: 2024-07-07
#+filetags: emacs hamacs #+filetags: emacs hamacs
#+lastmod: [2024-11-11 Mon] #+lastmod: [2025-01-28 Tue]
A literate programming file for literate programming in Emacs Org Files. 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. 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 ** Noweb References
A noweb definition, e.g. =<<something-something>>= should /jump/ to the =#name= definition. A noweb definition, e.g. =<<something-something>>= should /jump/ to the =#name= definition.
Since [[https://github.com/BurntSushi/ripgrep][ripgrep]] is pretty fast, Ill 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. Since [[https://github.com/BurntSushi/ripgrep][ripgrep]] is pretty fast, Ill 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.

View file

@ -31,6 +31,9 @@ cat > "$HAMACS_DEST/early-init.el" <<EOF
;; ;;
;;; Code: ;;; Code:
;; Need the package system near the front:
(require 'package)
;; We'll be using straight. So, we don't want duplicated package loading: ;; We'll be using straight. So, we don't want duplicated package loading:
(setq package-enable-at-startup nil) (setq package-enable-at-startup nil)
@ -79,9 +82,22 @@ cat > "$HAMACS_DEST/init.el" <<EOF
;; Bug fixes for ORG (there always seems to be something): ;; Bug fixes for ORG (there always seems to be something):
(defvar native-comp-deferred-compilation-deny-list nil) (defvar native-comp-deferred-compilation-deny-list nil)
;; Allow the installation of unsigned packages, but verify the signature if possible: ;; Allow the installation of unsigned packages, but verify the
;; signature if possible:
(setq package-check-signature 'allow-unsigned) (setq package-check-signature 'allow-unsigned)
;; While using Straight with direct Github repos,
;; adding Melpa and others isn't a bad idea:
(require 'use-package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives
'("elpa-dev" . "https://elpa.gnu.org/devel/"))
;; Configure straight https://github.com/raxod502/straight.el#getting-started ;; Configure straight https://github.com/raxod502/straight.el#getting-started
(defvar bootstrap-version) (defvar bootstrap-version)