Defer Optimizations

Hello, this isn’t a problem so much as maybe a discussion… I’m wondering what can be done – ideally to the entire Doom project – to increase the initial load time by optimizing module/package deferring. I started thinking about this when emacs want from 2ish seconds of load time to 4ish seconds! I ran a benchmark and noticed that yas and magit are taking up ridiculously long periods of time to load – more than anything else by a factor of ten. I looked into the module for magit and I see that it should be deferred, however it’s clearly still be loaded.

Here is the tree benchmark-init produced:


Loading data dump...

benchmark-init’s tabulated view adds up the various load times of a package and it’s dependencies to give a total time. It credits magit with two separate calls and both of them are over a second (1405ms and 1716ms)

I’m wondering if there is something wrong with the magit :defer in the magit module or if maybe there is something we can do to better optimize this deferment. magit especially has no business loading until I open a buffer which is in a folder managed by git.

System information


Loading data dump...

There’s something wonky with your setup. It seems to be loading a ton of stuff that really should either do deferred eager load or on-demand loading. The magit load on my side takes 2ms and that’s ~/.config/emacs/modules/tools/magit/config.el.