Last active
September 20, 2019 15:46
-
-
Save andreineculau/27491c1092d569f953bd854ad42b0789 to your computer and use it in GitHub Desktop.
fast emacs startup -- add the following to the beginning of your init.el
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; fast startup time | |
(setq gc-cons-threshold most-positive-fixnum) | |
(defvar original-file-name-handler-alist file-name-handler-alist) | |
(setq file-name-handler-alist nil) | |
(add-hook 'emacs-startup-hook | |
#'(lambda () (setq gc-cons-threshold 800000 | |
file-name-handler-alist original-file-name-handler-alist))) | |
;; (add-hook 'emacs-startup-hook | |
(add-hook 'after-init-hook | |
(lambda () | |
(message "Emacs ready in %s with %d garbage collections." | |
(format "%.2f seconds" | |
(float-time | |
(time-subtract after-init-time before-init-time))) | |
gcs-done))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment