From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Newsgroups: gmane.emacs.help Subject: Re: How to Reduce Emacs Load Time Date: Sun, 31 Aug 2008 13:39:32 +0200 Message-ID: <87ej45mn0r.fsf@arcor.de> References: <18aba2b0-4fc7-4588-b69f-d9f46b264b03@q26g2000prq.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1220182817 22752 80.91.229.12 (31 Aug 2008 11:40:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Aug 2008 11:40:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 31 13:41:12 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KZlIt-0006om-9h for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Aug 2008 13:41:11 +0200 Original-Received: from localhost ([127.0.0.1]:34917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZlHu-0003Aj-Ij for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Aug 2008 07:40:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KZlHY-0003AU-Dn for help-gnu-emacs@gnu.org; Sun, 31 Aug 2008 07:39:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KZlHW-0003AC-3y for help-gnu-emacs@gnu.org; Sun, 31 Aug 2008 07:39:47 -0400 Original-Received: from [199.232.76.173] (port=53710 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZlHV-0003A8-Tf for help-gnu-emacs@gnu.org; Sun, 31 Aug 2008 07:39:45 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:43858 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KZlHV-0007l6-Lh for help-gnu-emacs@gnu.org; Sun, 31 Aug 2008 07:39:45 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KZlHO-0007hg-VW for help-gnu-emacs@gnu.org; Sun, 31 Aug 2008 11:39:38 +0000 Original-Received: from dslc-082-082-176-047.pools.arcor-ip.net ([82.82.176.47]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Aug 2008 11:39:38 +0000 Original-Received: from de_bb by dslc-082-082-176-047.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Aug 2008 11:39:38 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslc-082-082-176-047.pools.arcor-ip.net Mail-Copies-To: never User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2.90 (gnu/linux) Cancel-Lock: sha1:6gryEeNMA/fIFg6bq7oZwKhCARo= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57146 Archived-At: formido 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