[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fast emacs?
Re: Fast emacs?
Sun, 17 May 2009 23:39:30 +0200
SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.7 Emacs/22.3 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)
> For ***years*** I've been looking for a solution to this problem,
> and I'm truly amazed that I have yet to find it: how to get a
> fast-starting version of emacs. The problem is that I have a big
> .emacs file and a big Emacs desktop, which means that my Emacs takes
> forever to start. This is fine most of the time, but occasionally
> I want a fast-starting emacs session (e.g. when I run "sudo emacs"
> to edit a superuser-owned config file), and it's infuriating to
> wait for emacs to go through a lengthy and useless song-and-dance...
> I just can't believe there is no way around this. (Other than, of
> course, using vi.)
> Note that using the emacsclient is no solution, because this requires
> that a version of Emacs be already running, which often defeats
> the purpose (not only do I have to wait another eternity for this
> new Emacs session to start, but then I have to start the server in
> the new session).
> Any words of wisdom would be much appreciated!
Emacs has tons of functionality baked in right from the start, yet its
startup time is reasonably fast if you don't have customizations. So,
learning from core emacs means learning how to start up fast. There
are lots of possible improvements you can make:
- don't use `require', use autoloads:
Magic comments can help, see (info "(elisp) Autoload")
Use `update-autoloads-from-directories' to automatically generate
the autoloads for you.
- for stuff that can only be configured once a library is loaded, use
- make a new emacs image with all your favourite libraries already
- start emacs as part of system startup with the --daemon switch:
- byte-compile the libraries you use; consider byte-compiling your
.emacs if it is huge
- remove extensions you don't use
- measure the progress you make: use the lisp function benchmark-run,
or `time' on the command line. Try adding (kill-emacs) at the end
of your .emacs file to get meaningful results for this.
My init file has 1677 lines, emacs starts in 2.3 seconds (hot
cache). Hmmm... this could be improved. 8-)
Re: Fast emacs?, Jean Magnan de Bornier, 2009/05/20