summaryrefslogtreecommitdiff
path: root/.config/emacs/early-init.el
diff options
context:
space:
mode:
authorbd <bdunahu@colostate.edu>2024-01-10 19:44:21 -0700
committerbd <bdunahu@colostate.edu>2024-01-10 19:44:21 -0700
commit1ced565816120bfcc351daf9fc3a4e851162e3b7 (patch)
tree93e9c23660cd07f4dba861f334b23c03d322f48c /.config/emacs/early-init.el
parentda5922a476cebdbbf338f0192165dbbbcd3f7b6f (diff)
Initial commit of new repository structure
Diffstat (limited to '.config/emacs/early-init.el')
-rw-r--r--.config/emacs/early-init.el28
1 files changed, 20 insertions, 8 deletions
diff --git a/.config/emacs/early-init.el b/.config/emacs/early-init.el
index a80caf9..671a562 100644
--- a/.config/emacs/early-init.el
+++ b/.config/emacs/early-init.el
@@ -1,14 +1,7 @@
;; -*- lexical-binding: t; -*-
-; external package manager
-(setq package-archives nil)
-
-
-(push '(menu-bar-lines . 0) default-frame-alist)
-(push '(tool-bar-lines . 0) default-frame-alist)
-(push '(background-color . "#000000") default-frame-alist)
-
+;;;; display load information + speedups
(defun bd/display-startup-time ()
(message "Emacs loaded in %s with %d garbage collections."
(format "%.2f seconds"
@@ -19,3 +12,22 @@
(add-hook 'emacs-startup-hook #'bd/display-startup-time)
(setq frame-inhibit-implied-resize t)
+
+;; reduce the frequency of garbage collection during startup
+;; by making it happen as little as possible
+;; TODO: `most-positive-fixnum' will pressure system memory if used
+;; as a permanent value
+(setopt gc-cons-threshold most-positive-fixnum
+ gc-cons-percentage 0.5)
+
+(add-hook 'emacs-startup-hook
+ (lambda ()
+ (setopt gc-cons-threshold (* 1024 1024 20)
+ gc-cons-percentage 0.2)))
+
+
+;;;; avoid-blinding startup
+(push '(menu-bar-lines . 0) default-frame-alist)
+(push '(tool-bar-lines . 0) default-frame-alist)
+(push '(background-color . "#000000") default-frame-alist)
+(push '(foreground-color . "#ffffff") default-frame-alist)