-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making scimax quicker? #340
Comments
I would be happy to see scimax startup speed up. At the moment I am trying to transition to emacs-jupyter, and that will probably keep me busy for a few months. I would be happy to look at pull requests to speed things up though. |
I hope to look a little deeper into this, as the claim of Doom emacs has always fascinated me! However, fwiw : on my Mac: (scimax + my 'bloated' config) startup in ~10 seconds. I tangle 100+ babel source blocks as a part of my config each time. The scale made me think whether further optimisation effort was truly worth it, additionally considering it becomes somewhat better using the daemon + client arrangement. But we are all young.. of course it would add up and in the least, would certainly be so cool and efficient if scimax started up 'instantly' :)
Perhaps, one generic direction would be some kind of delayed / deferred load of org-ref and all the heavier packages. I'd bet a lot of them are already deferred. Scimax's LOB probably adds a second or two.
Weirdly, (emacs-init-time) always shows me 0.3 !? Perhaps something to do with GC ? Iirc there are separate packages to profile Emacs though, and will have to dig.
|
Currently my setup is taking 25s to load. I am wondering what is taking so long. Running some analysis tells me that my user.el file is taking 10 seconds to load while the rest of scimax is taking 15s. Any idea how I can check what is taking so long for my user.el to load? |
Here is my esup output:
|
I am surprised org-ref loads so fast. pdf-tools especially is very slow for me. I don't have a very sophisticated way to check load times. There is a function (scimax-profile) but it is just a thin wrapper around esup. My startup is about 20 seconds. Of that: pdf-tools is almost 4 seconds, my user-dir is about 3 seconds, and scimax-lob is almost 3 seconds. I would have thought you could run esup on the file that loads your user directory too. Does that work for you? |
Good point. I just tried and I get the following error:
This seems a common issue with other emacs-kits such as spacemacs (jschaf/esup#48) and doom (doomemacs/doomemacs#788). I do not, however, understand how to make it work for scimax as my elisp is weak. Any idea? |
It is also an older issue in esup itself (jschaf/esup#46) I revived that issue, lets see what comes of it. |
Actually, I just tried a few of the suggestions outlined in the Doom readme. In specific - I finished adding the gc-cons-threshold tricks. The only variation from the doom config required is the symbol doom-gc-cons-threshold, which has to be set explicitly to the previous gc-cons-threshold hook. This shaved off 1.2 seconds from my start up via esup (though I am not using vanilla scimax atm). From what I've studied of the remaining tricks - they seem written in a format that can be directly implemented in ~ any configuration, including Scimax. Another note - Scimax's init.el already has the variations of gc-cons-threshold (start high and then scale down) implemented though the values are different. So - possibly unlikely to receive any benefit from this. Actually, I guess the following can be plugged into scimax's init.el, replacing the gc-cons-threshold commands that are currently set in Scimax's init.el
Of particular note in the snippet above is the adjusting the gc-cons-threshold when the mini-buffer is active and immediately reducing it thereafter. This has removed the very slight lag I experienced while calling ~some helm commands like helm-M-x (even on Scimax) making helm almost comparable in response to counsel. In fact, my overall mini-buffer response seems to be much better ! Another specific note is the caching function implemented for packages.el approach. I am currently using straight.el which apparently does this by default. I will try out the above in vanilla scimax and report. |
Unfortunately, esup does not seem to work for me with Scimax on Emacs 27 !? However, the load up time did seem marginally faster atleast. Anyway - I can confirm that the above snippet can be plugged into Scimax's init.el replacing the existing gc-cons-threshold commands without any apparent error. |
Inspired by a recent reddit post about the speed of doom emacs, I was wondering if some of the options shipped with doom could also help out startup speed of scimax.
https://github.com/hlissner/doom-emacs/blob/665b627b7c07c8d29ec8d334588cecc2ba308248/docs/faq.org#how-does-doom-start-up-so-quickly
The text was updated successfully, but these errors were encountered: