From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hongxu Chen Newsgroups: gmane.emacs.help Subject: Re: Speeding up Emacs load time Date: Fri, 28 Jun 2013 13:27:36 +0800 Message-ID: <877ghevm7r.fsf@gmail.com> References: <20130628032009.GA31464@hysteria.proulx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1372397282 29403 80.91.229.3 (28 Jun 2013 05:28:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Jun 2013 05:28:02 +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 07:28:03 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 1UsRE1-0001ly-55 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 07:28:01 +0200 Original-Received: from localhost ([::1]:35124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsRE0-0007U8-Ov for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jun 2013 01:28:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsRDn-0007Tb-Ns for help-gnu-emacs@gnu.org; Fri, 28 Jun 2013 01:27:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsRDj-0001ZB-CJ for help-gnu-emacs@gnu.org; Fri, 28 Jun 2013 01:27:47 -0400 Original-Received: from mail-pd0-x231.google.com ([2607:f8b0:400e:c02::231]:61052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsRDj-0001Yx-5w for help-gnu-emacs@gnu.org; Fri, 28 Jun 2013 01:27:43 -0400 Original-Received: by mail-pd0-f177.google.com with SMTP id p10so811639pdj.22 for ; Thu, 27 Jun 2013 22:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=iiMGN21Y5LVkECDst1qM5PPgW9xjddos8U/BghNmbz8=; b=LAMl4Vc+dRyAvFUAezQsAcNl7zc7+L0REKtky4+Cac3wjwP0dl9SZTT213x/55yUxz HAIWd1oM++xqrmmvLS/D5Akf/NxxUldgGEfgBj7wn6iTrBN+0kkiaAns0mCHuubivAFe 8z7yKzS91XOA63UtVcACljOpEydkJr8e65OOt3Wpw27OYRnpDmL/d6tN9X58e+SkVPe2 VbapAKAjuf8sKSJ24Le/yqAYM1iJ3eZSmYKycq7batBl62tkMaxqFp9lWNmM6MJuQW3o Wk4rud3D8OloLm+BvLUHrM0jNvQUCDeJ9hkXBQn5hdjB62kdZHs1KdgS+6BDAviztK8t IjSA== X-Received: by 10.66.161.166 with SMTP id xt6mr9775456pab.87.1372397261993; Thu, 27 Jun 2013 22:27:41 -0700 (PDT) Original-Received: from hongxuchen-VM.STAP ([167.220.232.198]) by mx.google.com with ESMTPSA id jb2sm6404285pbc.8.2013.06.27.22.27.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Jun 2013 22:27:40 -0700 (PDT) In-Reply-To: <20130628032009.GA31464@hysteria.proulx.com> (Bob Proulx's message of "Thu, 27 Jun 2013 21:20:09 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::231 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:91809 Archived-At: Bob Proulx writes: > 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 Hey Bob, would you mind sharing your .emacs settings(pastebin/gist/github or something like that)? Thanks. > > Bob -- Regards, Hongxu Chen