doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.39k stars 3.05k forks source link

Feature Request - flag to eager load as much as possible #2944

Open peterhoeg opened 4 years ago

peterhoeg commented 4 years ago

Describe the feature

Despite doom being wickedly fast at starting, there is still a case to be made for having an emacs daemon sitting around.

The first launch of emacsclient is slower than subsequent launches which seems to indicate that there is still some lazy loading happening.

It would be ideal to have an --eager-load flag or similar that would make doom load as much as possible on start.

hlissner commented 4 years ago

Doom already eager-loads its most expensive packages in daemon sessions. This includes yasnippet, helm, org, magit -- basically anything that is deferred incrementally (which, normally, Doom would load piecemeal, after X seconds of idle time).

Can you be specific about what slowness you're seeing? Org, for instance, is naturally slow the first time you open an org-mode buffer. This happens whether or not org has been pre-loaded. Doom has no way of addressing this (that I know of).

Flyspell is another case where the package is naturally slow, whether or not it is eagerly loaded.

Yasnippet, on the other hand, takes a long time indexing your snippets, which is eagerly loaded if you start a daemon session.

Depending on the issue, it may not be solved by eagerly loading said packages.

peterhoeg commented 4 years ago

Can you be specific about what slowness you're seeing?

Just to be clear - we're talking 100 ms here at most. It was just noticecable on 1st launch of emacsclient vs 2nd launch. I'll see if I can figure out what else can be eager loaded. Thanks for the pointers (and doom)!

jmromer commented 3 years ago

I notice that helpful is slow to load the first time any of the helpful-* commands is executed but more responsive on subsequent invocations. Presumably it's doing some indexing that could be asynchronously eager-loaded if it isn't already? I'll look into this when I have some time.