aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/init.org
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2020-04-20 21:23:20 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2020-04-20 21:23:20 +0200
commit927a1b1e40ddb29af9682f2dc38436f24a60ce78 (patch)
tree19685067a11b08aecbbbed035c05be22104dd44f /.emacs.d/init.org
parentde28b42c2443f578996e3e3ecf667839c0226c3e (diff)
downloaddotfiles-927a1b1e40ddb29af9682f2dc38436f24a60ce78.tar.gz
dotfiles-927a1b1e40ddb29af9682f2dc38436f24a60ce78.zip
emacs: better disable GC during startup
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to '.emacs.d/init.org')
-rw-r--r--.emacs.d/init.org20
1 files changed, 15 insertions, 5 deletions
diff --git a/.emacs.d/init.org b/.emacs.d/init.org
index 640fd89..407df06 100644
--- a/.emacs.d/init.org
+++ b/.emacs.d/init.org
@@ -83,11 +83,21 @@ Temporarily reduce garbage collection so startup time is lower. Idea taken from
[[https://github.com/purcell][@purcell]].
#+BEGIN_SRC elisp
- (defconst mssola-initial-gc-cons-threshold gc-cons-threshold
- "Initial value of `gc-cons-threshold' at start-up time.")
- (setq gc-cons-threshold (* 1024 1024 1024))
- (add-hook 'after-init-hook
- (lambda () (setq gc-cons-threshold mssola-initial-gc-cons-threshold)))
+(defconst mssola-initial-gc-cons-threshold gc-cons-threshold
+ "Initial value of `gc-cons-threshold' at start-up time.")
+
+(defconst mssola-initial-gc-cons-percentage gc-cons-percentage
+ "Initial value of `gc-cons-percentage' at start-up time.")
+
+;; Completely disable the GC by having a ginormous threshold.
+(setq gc-cons-threshold most-positive-fixnum
+ gc-cons-percentage 0.6)
+
+;; Enable the GC back again to its
+(add-hook 'after-init-hook
+ (lambda ()
+ (setq gc-cons-threshold mssola-initial-gc-cons-threshold
+ gc-cons-percentage mssola-initial-gc-cons-percentage)))
#+END_SRC
User name and email.