mirror of
https://github.com/larstvei/dot-emacs.git
synced 2024-11-26 07:28:31 +00:00
Fix faster startup time
The gc-cons-threshold wasn't reset! I think this caused some lag, due to long gc breaks.
This commit is contained in:
parent
d6e1d07dab
commit
3d81cb5162
9
init.org
9
init.org
@ -158,14 +158,17 @@
|
|||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** Faster startup
|
||||||
|
|
||||||
A common optimization is to temporarily disable garbage collection during
|
A common optimization is to temporarily disable garbage collection during
|
||||||
initialization. Here, we set the ~gc-cons-threshold~ to a ridiculously large
|
initialization. Here, we set the ~gc-cons-threshold~ to a ridiculously large
|
||||||
number, and restore the default value after initialization.
|
number, and restore the default value after initialization.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle early-init.el
|
#+begin_src emacs-lisp :tangle early-init.el
|
||||||
|
(setq gc-cons-threshold most-positive-fixnum)
|
||||||
(setq gc-cons-threshold (* 100 1024 1024))
|
(add-hook 'after-init-hook
|
||||||
|
(lambda ()
|
||||||
|
(setq gc-cons-threshold (* 1024 1024 20))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Packages
|
* Packages
|
||||||
|
Loading…
Reference in New Issue
Block a user