emacs startup is extremely slow, is there anything I can do to make it faster?

202 views
Skip to first unread message

Jeff Bowman

unread,
Apr 11, 2016, 5:47:03 PM4/11/16
to Emacs Prelude
First, I know I'm loading a bunch of modules and I know that takes time, I'm perfectly happy to wait for a few seconds as emacs loads. For me a few seconds is maybe 5-10. This is how emacs used to load, but recently (ie with the last few updates I've done since February 2016), it has become dramatically slower. I have not added any new code or packages, just M-x package-list-packages RET U x, then M-x prelude-update and restart emacs. Now it takes up to 90 seconds for emacs to start. I tried recently to install and use the package esup which would hopefully profile my startup so I could find where the bottlenecks were and hopefully address them. However, running M-x esup give the following error:

(wrong-type-argument stringp nil)


when it reaches the line:

(defvar prelud-dir (file-name-directory load-file-name)


Could someone point me in a direction to continue trying to figure out what might be causing the slow down? Any advice would be appreciated.

Thanks!
Jeff

Jeff Bowman

unread,
Apr 13, 2016, 12:39:08 PM4/13/16
to Emacs Prelude
So, tried removing all of my configuration and just starting from scratch with prelude. I ignore the startup time from the first run after installing prelude as that is getting packages for the modules included. However, startup for the second run is in the minutes range with no additional configuration (ie default everything, I didn't even change the prelude-modules.el file). 

Anyway, food for thought. Still love prelude, used it for a while now. I've tried some others, but keep coming back. Just so used to how things are setup. May have to look into running emacs --daemon on login, then just using emacsclient -c which is *very* fast on startup (of course ;-) )

Regards,
Jeff

Colin Yates

unread,
Apr 13, 2016, 12:46:50 PM4/13/16
to emacs-...@googlegroups.com
I used prelude for quite a while and didn't experience this. I have
since moved to spacemacs and can _heartily_ recommend it. The
discoverability and the sane keybindings are great. If you like the vi
modal editing then that is also a win, but spacemacs can work just
fine in non-modal editing as well.
> --
> You received this message because you are subscribed to the Google Groups
> "Emacs Prelude" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emacs-prelud...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jeff Bowman

unread,
Apr 13, 2016, 12:57:01 PM4/13/16
to Emacs Prelude
I've tried spacemacs, and it is very cool. The only thing I ran into with it was getting the packages I wanted. The layer thing is a neat idea, and I probably didn't stick with it long enough to really be successful, but finding the layers I wanted to do the things I needed was not as obvious for me. That being said, I still like it quite a bit. I'm a bit more comfortable with the emacs bindings rather than the vi bindings, but that is marginal. 

For me, just selecting packages from the package list is straight forward enough that I miss it when I try others, and spacemacs (however cool it is) just falls into this category. (see previous comment about not sticking with it long enough, so I may be talking out of my left ear here :-) )

Thanks for the reply.
Jeff

Jeff Bowman

unread,
Apr 26, 2016, 7:19:12 PM4/26/16
to Emacs Prelude
So, a bit more digging, the slow part of the prelude startup seems to be in `prelude-editor.el`.

I'm still digging into it, but even with a clean install of emacs, clean install of prelude with all default options and no customizations, starting emacs takes about 2 minutes. This is egregiously long. Yes, running `emacs --daemon` as part of my autostart options when logging in means using emacsclient will start nearly immediately, but I still incur the cost of 2 minutes to load the daemon. Anyway, I'm working on trying to get this down some, I'll post more here as I find more.

Regards,
Jeff

Jeff Bowman

unread,
Apr 26, 2016, 9:54:49 PM4/26/16
to Emacs Prelude
The problem, in my case, seems to be loading tramp in prelude-editor.el. Following the advice here: emacs-suspend-at-startup-ssh-connection-issue seems to have solved the problem, which I put in my preload configuration since the configuration had to be set before loading tramp.

Load time went from +2 minutes to just less than 3 seconds.

Hope that helps someone!

Regards,
Jeff
Reply all
Reply to author
Forward
0 new messages