From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.help Subject: Re: Speeding up Emacs load time Date: Thu, 25 Jul 2013 09:25:00 +0200 Organization: Sebastien Vauban Message-ID: <86fvv3cd9v.fsf@somewhere.org> References: <86hafjwukz.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374737118 25570 80.91.229.3 (25 Jul 2013 07:25:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jul 2013 07:25:18 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Thu Jul 25 09:25:21 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 1V2FvM-00041U-8X for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jul 2013 09:25:20 +0200 Original-Received: from localhost ([::1]:33757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2FvL-0002FQ-RA for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jul 2013 03:25:19 -0400 Original-Path: usenet.stanford.edu!goblin2!goblin.stu.neva.ru!aioe.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 80 Injection-Info: mx05.eternal-september.org; posting-host="402b34550bd938aa98825778083dce0e"; logging-data="24228"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX19V/Zd9KhE1HhJtePFjTpoG" User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (windows-nt) X-Archive: encrypt Cancel-Lock: sha1:EovlVnA9/8hC8h1GddKXlE2nTq0= sha1:Y2ZLslQkUWfTVZfSHeFkTOHgTPo= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.help:200117 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.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-mXXj517/zsQ@public.gmane.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:92383 Archived-At: Hi J. David, J. David Boyd wrote: > "Sebastien Vauban" writes: >> Glyn Millington wrote: >>> One popular technique is not to load packages until you need 'em. That means >>> fewer 'requires' in your .emacs/init.el file and more autoloads. >>> >>> See tips 3-5 here! >>> >>> http://a-nickels-worth.blogspot.co.uk/2007/11/effective-emacs.html >>> >>> The key function is eval-after-load >> >> I'm using GNU Emacs on Windows, and using the above, I could reduce my load >> time from 10+ seconds to 3 seconds. Still 3 x over many of you, which report >> sub-seconds load time. >> >> Though, I'm a bit blocked. I don't understand how to do better, or how to >> completely avoid all the require commands. >> >> Just take a few exemple: >> >> - `(server-start)' takes more than 200 ms to run [1]; just that one command. >> Though, I must have it in my .emacs file, right? >> >> - diff-mode-.el must be loaded before diff-mode; hence, I must have it at >> startup. >> >> - Helm is my tool for opening files or switching between buffers. Just >> requiring `helm-config' (almost only autoloads) -- hence, NOT `helm' (which >> is more hungry in time) -- already takes 160 ms (as it still requires >> `easy-menu' and `helm-aliases'). >> >> - `diary-lib' and co (needed for appointments notification) takes 233 ms. >> Shouldn't I be notified at startup of events occurring in less than 15 >> minutes, without having to make a first call to calendar or so? >> >> - `mic-paren' takes just 32 ms, but for just one small package, for which I >> don't have a particular trigger. Is it `find-file-hook'? Then, I won't have >> parenthesis highlighted when directly typing text in a newly created buffer >> (or in the scratch). So, I need it in my .emacs. It's not eval'ed-after-load >> of something else. >> >> - The same for YASnippet (loaded in 130 ms): what would be the trigger? >> Unless I have a clear one, I must require it in my .emacs file. >> >> - Once again, the same with `recentf', which takes 92 ms. Don't I have to load >> it right at startup? >> >> These are a couple of examples which take a lot of the time, and for which I >> don't see a specific trigger that would allow me to defer their load to later. >> >> Any comments? >> >> Best regards, >> Seb >> >> [1] The above are times on a very recent laptop i7, when on mains. Multiply >> times by 3.5 when on battery. > > Are you using Cygwin? And the X11 binary, or the Ming-W binary? I'm using GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2013-07-07 on LEG570 (compiled W32 binary from DropBox in this case, by Dani Moncayo) -- but I indifferently use the (older, I mean for Emacs 24.3) binaries as well from the FSF Web site. So, I never (try to) compile Emacs by myself. I do have Cygwin installed on my machine. I don't use Ming-W nor X11. Best regards, Seb -- Sebastien Vauban