FYI and thanks
hhnr opened this issue · 2 comments
Hi,
Thank you for sharing your configuration, elisp libraries and over all contribution to emacs. I have cloned your emacs configuration and emacs starts under a second. How do you manage to keep the emacs init time very low? I use use-package macro and for me emacs takes few seconds to startup. Can you share some pointers or write up a blog post on how you make emacs startup fast?
Thanks
Thank you for sharing your configuration, elisp libraries and over all contribution to emacs.
You're welcome.
I have cloned your emacs configuration and emacs starts under a second. How do you manage to keep the emacs init time very low? I use use-package macro and for me emacs takes few seconds to startup.
A lot of stuff is autoloaded. See hooks.el
- it contains 72 add-hook
statements. The functions in add-hook
are usually defined in their own file, which is related to the corresponding major-mode.
So instead of loading ~72 files and all dependencies that they pull in, I load only 72 add-hook
statements that are instant because they don't load any packages.
Then when e.g. python-mode
is opened:
- It calls
python-mode-hook
, - which calls
ora-python-hook
, - which is autoloaded from ora-python.el,
- which means that the whole content of ora-python.el is loaded only when the first
python-mode
file is opened.
See also update-all-autoloads
, which generates the loaddefs.el
file.
Can you share some pointers or write up a blog post on how you make emacs startup fast?
I thought that I already had written that subject, but I can't find it now. If I don't find it, I'll make a blog post when I have time.
That's interesting. I think spacemacs also does something similar? It installs python mode specific packages only when the first python mode file is opened.
I will look into the your configuration. Looking forward to your blog post!
Thanks.