From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anselm Helbig Newsgroups: gmane.emacs.help Subject: Re: Fast emacs? Date: Sun, 17 May 2009 23:39:30 +0200 Organization: Freie Universitaet Berlin Message-ID: <87ws8fflyl.wl%anselm.helbig+news2009@googlemail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1242596494 16039 80.91.229.12 (17 May 2009 21:41:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 May 2009 21:41:34 +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 May 17 23:41:25 2009 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 1M5o6m-00018c-Gp for geh-help-gnu-emacs@m.gmane.org; Sun, 17 May 2009 23:41:24 +0200 Original-Received: from localhost ([127.0.0.1]:35674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M5o6l-00058X-Te for geh-help-gnu-emacs@m.gmane.org; Sun, 17 May 2009 17:41:23 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin2!goblin.stu.neva.ru!newsfeed.bahnhof.se!newsfeed101.telia.com!nf02.dk.telia.net!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 62 Original-X-Trace: news.uni-berlin.de sw62McdzaRCx0NbNmi0SQweJA4rT65NXZVcylOvUWtA7WS9j2ZeQ8mBLC8 Cancel-Lock: sha1:oCMUT8VR+K9PPW8fnrjFMqgkL9Y= In-Reply-To: Mail-Followup-To: anselm.helbig+news2009@googlemail.com User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/22.3 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) Original-Xref: news.stanford.edu gnu.emacs.help:169264 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:64517 Archived-At: Hi! > For ***years*** I've been looking for a solution to this problem, > and I'm truly amazed that I have yet to find it: how to get a > fast-starting version of emacs. The problem is that I have a big > .emacs file and a big Emacs desktop, which means that my Emacs takes > forever to start. This is fine most of the time, but occasionally > I want a fast-starting emacs session (e.g. when I run "sudo emacs" > to edit a superuser-owned config file), and it's infuriating to > wait for emacs to go through a lengthy and useless song-and-dance... > > I just can't believe there is no way around this. (Other than, of > course, using vi.) > > Note that using the emacsclient is no solution, because this requires > that a version of Emacs be already running, which often defeats > the purpose (not only do I have to wait another eternity for this > new Emacs session to start, but then I have to start the server in > the new session). > > Any words of wisdom would be much appreciated! Emacs has tons of functionality baked in right from the start, yet its startup time is reasonably fast if you don't have customizations. So, learning from core emacs means learning how to start up fast. There are lots of possible improvements you can make: - don't use `require', use autoloads: http://www.emacswiki.org/emacs/AutoLoad Magic comments can help, see (info "(elisp) Autoload") Use `update-autoloads-from-directories' to automatically generate the autoloads for you. - for stuff that can only be configured once a library is loaded, use `eval-after-load'. - make a new emacs image with all your favourite libraries already loaded: http://www.emacswiki.org/emacs/DumpingEmacs - start emacs as part of system startup with the --daemon switch: http://www.emacswiki.org/emacs/EmacsAsDaemon - byte-compile the libraries you use; consider byte-compiling your .emacs if it is huge - remove extensions you don't use - measure the progress you make: use the lisp function benchmark-run, or `time' on the command line. Try adding (kill-emacs) at the end of your .emacs file to get meaningful results for this. My init file has 1677 lines, emacs starts in 2.3 seconds (hot cache). Hmmm... this could be improved. 8-) Happy tuning! Anselm -- Anselm Helbig mailto:anselm.helbig+news2009@googlemail.com