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.
Advanced techniques for reducing Emacs startup time
21–30 of 83 posts
Re: Advanced techniques for reducing Emacs startup time
#22Just thought I'd add a side-note;
For anyone wanting to try emacs really give "Doom Emacs" a try ! It's brilliant and comes with vim-bindings (a.k.a evil-mode) !
Doom Emacs has spend a lot of time on making emacs(doom) fast !
Re: Advanced techniques for reducing Emacs startup time
#23Earlier quoted context omitted.
You can instruct Emacs (with or without emacsclient) to open in a terminal with: emacsclient -nw That way, you'll connect to your Emacs server but using a terminal Emacs (even if your main instance is GUI Emacs)
Oh, I wonder how I had missed that option. Thanks!
Re: Advanced techniques for reducing Emacs startup time
#24Ideally 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)
except that use-package, by itself, does not install anything . NOTE: use-package is not a package manager! Although use-package does have the useful capability to interface with package managers (see below), its primary purpose is for the configuration and loading of packages. (I use straight, which interfaces nicely into use-package.)
It can be configured to install things (by using the builtin package.el): https://jwiegley.github.io/use-package/keywords/#ensure-pin
> You can use use-package to load packages from ELPA with package.el. This is particularly useful if you share your .emacs among several machines; the relevant packages are downloaded automatically once declared in your .emacs. The :ensure keyword causes the package(s) to be installed automatically if not already present on your system (set (setq use-package-always-ensure t) if you wish this behavior to be global for all packages)
So if all you need is package.el (and there's a good chance that's the case), you can just
(setq use-package-always-ensure t)
and your configuration will now install the packages if you copy it to a new system.Re: Advanced techniques for reducing Emacs startup time
#25Because this is an old post, references like Spacemacs are now quite dated. Folks prefer Doom Emacs nowadays (though I don't use either of them).
Re: Advanced techniques for reducing Emacs startup time
#26Emacs (much like VSCode or Idea) is a tool that I use for everything, all day. I don't see a point in shutting it down, except for upgrading the version. Its startup time of, say, 15 or even 30 seconds (if you start many language servers) is only paid once, when I log in.
So I run it in server mode, and emacsclient start instantly, as a GUI window, or in a terminal, with all the amenities of an IDE already in place.
Re: Advanced techniques for reducing Emacs startup time
#27I’d like to see something like this but for speeding up Emacs at runtime. I have a 0.25s startup time with packages but my Emacs struggles when using lsp-mode or eglot in large C++ projects. I’ve been using Sublime Text lately but would like to get back to Emacs.
Re: Advanced techniques for reducing Emacs startup time
#28(On the other hand, emacs is never quite problem free, so maybe this is introducing problems and I just haven't noticed.)
I have tons of customizations and lots of packages, but be as religious as reasonable about lazy loading.
$ time emacs --eval '(save-buffers-kill-emacs)'
real 0.21s
Not bad, but still very noticable, which is annoying.About half of it is unavoidable.
$ time emacs -q --eval '(save-buffers-kill-emacs)'
real 0.11s
(-q disables reading the config file.)(With default GC settings, startup is about 300ms.)