From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Speeding up Emacs load time Date: Thu, 27 Jun 2013 21:20:09 -0600 Message-ID: <20130628032009.GA31464@hysteria.proulx.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1372389623 29827 80.91.229.3 (28 Jun 2013 03:20:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Jun 2013 03:20:23 +0000 (UTC) Cc: Emacs Help To: Andrew Pennebaker Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 28 05:20:23 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UsPEV-00066C-E7 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 05:20:23 +0200 Original-Received: from localhost ([::1]:41104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsPEU-0003jd-VO for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Jun 2013 23:20:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsPEK-0003iV-6h for help-gnu-emacs@gnu.org; Thu, 27 Jun 2013 23:20:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsPEJ-0000GB-3n for help-gnu-emacs@gnu.org; Thu, 27 Jun 2013 23:20:12 -0400 Original-Received: from joseki.proulx.com ([216.17.153.58]:33709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsPEI-0000G5-SO for help-gnu-emacs@gnu.org; Thu, 27 Jun 2013 23:20:11 -0400 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 0E96A211DB; Thu, 27 Jun 2013 21:20:10 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id D68D42DCE9; Thu, 27 Jun 2013 21:20:09 -0600 (MDT) Mail-Followup-To: Andrew Pennebaker , Emacs Help Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91808 Archived-At: 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