all repos — nixfiles @ c06201a3cbe2f17669d37292a63ea532e4402b51

System and user configuration, managed by nix and home-manager

Emacs: optimise startup and GC
Alan Pearce alan@alanpearce.eu
Thu, 27 Feb 2020 12:20:20 +0100
commit

c06201a3cbe2f17669d37292a63ea532e4402b51

parent

e2c59a95f621160ddc8196d4887797ce1e9b915f

1 files changed, 7 insertions(+), 1 deletions(-)

jump to
M user/emacs/.emacs.d/init.eluser/emacs/.emacs.d/init.el
@@ -1,4 +1,4 @@-;;; init --- user init file
+;;; init --- user init file  -*- lexical-binding: t; -*-
 (setq inhibit-startup-echo-area-message "alan")
 (setq inhibit-startup-screen t
       initial-scratch-message ""
@@ -6,6 +6,12 @@ initial-major-mode 'fundamental-mode       package-enable-at-startup nil
       evil-want-keybinding nil
       frame-inhibit-implied-resize t)
+
+(setq gc-cons-threshold most-positive-fixnum
+      gc-cons-percentage 0.6)
+(add-hook 'emacs-startup-hook (lambda ()
+                                (setq gc-cons-threshold (* 16 1024 1024)
+                                      gc-cons-percentage 0.1)))
 
 (package-initialize)