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

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

Re: How to Reduce Emacs Load Time


From: David
Subject: Re: How to Reduce Emacs Load Time
Date: Sun, 31 Aug 2008 13:39:32 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2.90 (gnu/linux)

formido <address@hidden> writes:
> Emacs takes like 10 seconds to load. It's a lot faster if I don't load
> all my packages. What strategies could I use to get my load time down?

First, you should identify what parts of your .emacs take so long. You
can do this e.g. by starting emacs with "emacs -q", set up your
load-path, and then evaluate

(benchmark-run
  (require 'package))

The first number appearing in the echo area will be the time needed to
run that command.

> Emacs itself is made up of tons of elisp files and it doesn't take
> forever to load, so I don't see why I should be forced to endure long
> load times just because I add third party packages.

Many packages from Emacs use autoloads, which delay the loading of the
complete package until one of the interactive functions is used.

> If I do, 'require package', I'm at the mercy of the package maker's
> initialization process, right?

Essentially, yes. But maybe you "require" too much. My emacs startup
time is ~1sec, although I include large third party packages like CEDET
and Gnus. For example, for setting up Gnus, you should only require
'gnus-load in your .emacs, which contains the proper autoloads. This
takes about 0.03 seconds on my machine.

If you want to set options which need to be evaluated after a package is
loaded, you can use eval-after-load.

-David





reply via email to

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