Skip to content

Instantly share code, notes, and snippets.

@andreineculau
Last active September 20, 2019 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreineculau/27491c1092d569f953bd854ad42b0789 to your computer and use it in GitHub Desktop.
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
;; 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