Live data from Hacker News

Advanced techniques for reducing Emacs startup time

blog.d46.us

1–10 of 83 posts

Re: Advanced techniques for reducing Emacs startup time

#5
post #3

Easiest thing is just not to quit! I stopped autoloading things, as i found it less bothersome to wait 30 seconds for Emacs to load than to get surprised by an autoload delay while working.

Came here to say this. I'm starting Emacs only after a reboot, who cares if it takes 3s or 30s to launch (mine around 5 or so.)

Use emacsclient if you want to use it as $EDITOR.

https://emacsredux.com/blog/2014/12/23/uptime/

Re: Advanced techniques for reducing Emacs startup time

#6
My Emacs takes ages to start but for a reason. It takes most of the time to automatically load every file I've ever edited into a buffer. Finding the right buffer is much faster for me than navigating the filesystem, and whenever I use bookmarks they're outdated too quickly or I can't remember them. I guess my habit is the equivalent of piling papers on a desk.

Re: Advanced techniques for reducing Emacs startup time

#7
While I’m very much in the “don’t really care” camp cos I don’t quit Emacs often, I did find optimising my startup time quite educational, and moving to use-package gave me an opportunity to go through every mode in detail, instead of just making the occasional ad-hoc tweak when something annoyed me.

I would also point out that early-init exists these days and is the best place for some startup logic (especially bits that prevent UI ever being shown so you don’t get weird flashes of stuff during startup).

Re: Advanced techniques for reducing Emacs startup time

#8

My Emacs takes ages to start but for a reason. It takes most of the time to automatically load every file I've ever edited into a buffer. Finding the right buffer is much faster for me than navigating the filesystem, and whenever I use bookmarks they're outdated too quickly or I can't remember them. I guess my habit is the equivalent of piling papers on a desk.

I just use recentf for that. My buffer list contains everything in the recentf (this works with buffer list replacements from both Helm and Ivy). Makes it trivial to open up any file I've had open before.

Opening all buffers you've ever edited sounds nuts to me. What if one of the files you edited was a 10 gb log file or whatever?

Re: Advanced techniques for reducing Emacs startup time

#9
Ideally use-package would simply be included in emacs, so you could rely on it.

Apparently they are getting close: https://github.com/jwiegley/use-package/issues/282

Until then, I have this in my init.el to install it if necessary:

    ;; Install use-package because that installs everything else
    (unless (package-installed-p 'use-package)
      (package-refresh-contents)
      (package-install 'use-package))

    (require 'use-package)

Re: Advanced techniques for reducing Emacs startup time

#10
post #4
post #2

Quoted post unavailable.

Completely unproductive comment teasing an old pointless flame war.

(Despite the comment clearly being flamewar bait...)

Most of the other comments are correctly suggesting to just not exit emacs. Something opening slowly once at the beginning of a long workflow is hardly an issue. If you must open something quickly over and over again, being proficient in a secondary lightweight editor like vim wouldn't be a bad suggestion.

Post reply on HN