help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speeding up Emacs load time


From: Bob Proulx
Subject: Re: Speeding up Emacs load time
Date: Thu, 27 Jun 2013 21:20:09 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

Andrew Pennebaker wrote:
> I love Emacs's customizability! I regularly edit my .emacs file, and the
> community has been helpful and encouraging. But I do notice that Emacs can
> take several (10) seconds or longer to load.

My .emacs used to take a while to load as well.  But eventually I made
an effort to speed it up and now it is sub-second.

> For reference, I'm using Emacs 24.1 for Mac OS X, Windows, and Android. I
> keep my .emacs synced, shared, and backed up on GitHub.
> https://github.com/mcandre/dotfiles/blob/master/.emacs
>
> Could someone help me cut down the load time while maintaining the same
> behavior?

I looked at your .emacs file.  It is rather extensive.  Time consuming
parts are usually anytime you (require 'foo) or (load "foo").  Do you
really need all of those executed each and every time you start emacs?
Probably not.

Walk through every one of those in your .emacs file and make sure that
they are placed within an appropriate (eval-after-load "foo" ...)
wrapping like you have for the "grep" case so that they don't take
place at load time but take place only when that particular feature is
used.  If there is confusion then pick one and ask about it.  And then
another.  And continue until all of them are only loaded when that
feature is used.

When timing your startup time how long does it take to start emacs
when not loading anything?  When loading the system startup only?

Timings from my system after much optimization.

  $ time emacs -f kill-emacs
  real    0m0.157s
  user    0m0.140s
  sys     0m0.012s
  $ time emacs -q -f kill-emacs
  real    0m0.137s
  user    0m0.116s
  sys     0m0.016s
  $ time emacs -Q -f kill-emacs
  real    0m0.051s
  user    0m0.028s
  sys     0m0.020s

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]