unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* faster emacs startup, can I postpone package loading?
@ 2006-01-02 20:27 mitchell_laks
  2006-01-02 21:40 ` Thorsten Bonow
  2006-01-06 13:56 ` kgold
  0 siblings, 2 replies; 9+ messages in thread
From: mitchell_laks @ 2006-01-02 20:27 UTC (permalink / raw)


Hi,

I run debian and use emacs as my editor. On  some systems I have many
packages that customize emacs for their own purposes. These packages
include such things as eieio, macsyma cedet-common tex etc.

On some of these systems the load process significantly slows down the
boot process. While emacs on some systems is immediately there, here it
can take 4 seconds (gasp).
On other systems I have with less 'crud' (extraordinary software that I
do use occassionally), it comes up faster than a rabbit. As fast as
(shudder) vi. (I wrote my thesis using vi, a long ways ago, and don't
want to go that way again).

(I originally was going to write that it takes 10 seconds to boot, but
I solved that problem when I realized that emacs was doing a reverse
dns lookup  and it went down to 4 seconds as soon as I added the
workstation ip address itself to the /etc/hosts file).

When I look in the *Messages* buffer I see the following load list (see
below).

Now all this is by virtue of Debian packaging adding loads. I did not
really modify the .emacs file too much.

Is there some simple way that I can make all this (exciting) loading
take place in the few seconds after I get my prompt and am working on
my files?

Note that I am a lisp newbie, I can barely car, cdr and setq, though I
own SICP, Lispcraft, On Lisp, Common Lisp and even once printed out the
gnu emacs-lisp manual.... :)

Thanks!

Mitchell Laks

Loading 50a2ps (source)...done
Loading 50aribas (source)...done
Loading 50auctex (source)...done
Loading 50autoconf (source)...done
Loading 50cedet-common (source)...
Loading advice...done
Loading 50cedet-common (source)...done
Loading 50dictionaries-common (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el
(source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el
(source)...done
Loading 50dictionaries-common (source)...done
Loading 50eieio (source)...done
Loading 50ess (source)...
Loading regexp-opt...done
Loading mule-util...done
Loading ange-ftp...done
Loading 50ess (source)...done
Loading 50ftnchek (source)...done
Loading 50gri-el (source)...done
Loading 50gri-html-doc (source)...done
Loading 50maxima-emacs (source)...done
Loading 50mgp (source)...done
Loading 50mpqc-support (source)...done
Loading 50nowebm (source)...done
Loading 50octave (source)...done
Loading 50preview-latex (source)...done
Loading 50tramp (source)...done
Loading 50yacas (source)...done
Loading 50yorick-auto (source)...done
Loading 51ede (source)...done
Loading 51preview-latex (source)...
Loading preview-latex...done
Loading 51preview-latex (source)...done
Loading 51speedbar (source)...done
Loading 52semantic (source)...
Loading derived...done
Loading /usr/lib/emacs/21.4/i386-linux/fns-21.4.1-x.el (source)...done
Loading semantic-idle (source)...done [2 times]
Loading ede-speedbar (source)...done
Loading 52semantic (source)...done
Loading 53cedet-contrib (source)...done
Loading 53cogre (source)...done
Loading 55ecb (source)...
"/usr/share/emacs21/site-lisp/cedet-common/" added to `load-path'
Error while loading 55ecb
Loading semantic-el (source)...done
For information about the GNU Project and its goals, type C-h C-p.
call-interactively: Beginning of buffer [14 times]
call-interactively: End of buffer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: faster emacs startup, can I postpone package loading?
  2006-01-02 20:27 mitchell_laks
@ 2006-01-02 21:40 ` Thorsten Bonow
  2006-01-06 13:56 ` kgold
  1 sibling, 0 replies; 9+ messages in thread
From: Thorsten Bonow @ 2006-01-02 21:40 UTC (permalink / raw)


>>>>> "mitchell" == mitchell laks <mitchell_laks> writes:

    [...]

    mitchell> Is there some simple way that I can make all this (exciting)
    mitchell> loading take place in the few seconds after I get my prompt and am
    mitchell> working on my files?

    [...]

Sorry if this is completely off target, but do you know about the "emacsclient"?
I'm just starting my emacsen when logging in and do all my editing via calling
emacsclient, never exiting Emacs at all. Calls to emacsclient are usually as
fast as calling vi(m). So the lag on startup would only hit you once...

It's documented in the Emacs Manual:

Using Emacs as a Server

* Invoking emacsclient:: Emacs client startup options.

Hope this helps.

Toto

-- 
Contact information and PGP key at
http://www-users.rwth-aachen.de/thorsten.bonow

'It's the girl in the peach coloured dress,' he said. I stared
intently at the puppet head on the table. 'What the hell's going
on?' shouted Ratso. 'Aren't you gonna talk to her?' I turned the
puppet head a little to one side and then a little to the
other. You couldn't even tell it had been wounded. 'I'll speak to
her,' I said, 'when the glue is dry.'

Kinky Friedman: When the Cat's Away

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: faster emacs startup, can I postpone package loading?
@ 2006-01-03  1:12 ` BRUCE INGALLS
  2006-01-03 18:03   ` Kevin Rodgers
  0 siblings, 1 reply; 9+ messages in thread
From: BRUCE INGALLS @ 2006-01-03  1:12 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 969 bytes --]

>
> From: "mitchell_laks"

Date: 2 Jan 2006 12:27:52 -0800
> Subject: faster emacs startup, can I postpone package loading?
>
> On some of these systems the load process significantly slows down the
> boot process. While emacs on some systems is immediately there, here it
> can take 4 seconds (gasp).
>


Now all this is by virtue of Debian packaging adding loads. I did not
> really modify the .emacs file too much.
>
> First, you'd have track down, where all the loading is happening.
Perhaps this happens in a file like /usr/share/emacs/site-start/site-init.el

Next, you can try Jari Aalto's tiny-load: http://tiny-tools.sourceforge.net/
It loads packages during idle time. I use it in
http://emacro.sourceforge.net/
However, sometimes it seems that interrupting the load stops it.

While it is popular to compare Emacs to vi, I believe that it compares more
to Eclipse or Visual Studio, each of which take at least 4x as long to load
:(

[-- Attachment #1.2: Type: text/html, Size: 1583 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: faster emacs startup, can I postpone package loading?
       [not found] <mailman.21176.1136250882.20277.help-gnu-emacs@gnu.org>
  2006-01-03  1:12 ` faster emacs startup, can I postpone package loading? BRUCE INGALLS
@ 2006-01-03  2:38 ` mitchell_laks
  2006-01-03  3:34   ` Ian Zimmerman
  1 sibling, 1 reply; 9+ messages in thread
From: mitchell_laks @ 2006-01-03  2:38 UTC (permalink / raw)


> >
> > First, you'd have track down, where all the loading is happening.
> Perhaps this happens in a file like /usr/share/emacs/site-start/site-init.el

Thank you! Bingo!

The directories /usr/share/emacs and /usr/share/emacs21 are interesting

ls /usr/share/emacs/site-lisp/

a2ps           cogre                ftnchek.el         preview-latex
aplus-fsf-el   csh-mode.el          gri-mode.el        semantic
aribas         debian-startup.el    kdesdk-scripts     speedbar
auctex         dictionaries-common  maxima             tramp
autoconf       ecb                  mgp                yacas
cedet-common   ede                  mpqc
cedet-contrib  eieio                noweb-mode.el
chktex.el      ess                  octave2.1-emac

There is a file debian-startup.el and the directories correspond to the

things that emacs loaded during startup.

While in
/usr/share/emacs21/site-lisp/

ls /usr/share/emacs21/site-lisp/
a2ps    cedet-common   debian-startup.elc   ede    gri-mode.elc
octave2.1-emacsen  speedbar     tramp
aribas  cedet-contrib  dictionaries-common  eieio  maxima
preview-latex      subdirs.el   yacas
auctex  cogre          ecb                  ess    mpqc
semantic           tex-site.el


There,  in the ../emacs21/.. directory
the file is a compiled file .elc.

I had noticed that when I installed on debian a program that has a
emacs component, alot of compiling goes on.

Also emacs seems to be known as emacs21 on debian, so maybe that is the
right location.

But I can't read debian-startup.elc but I can read the
debian-startup.el  in ../emacs/ .. :).

Seems to refer to the load sequence ... :( very lispy :(


;; debian-startup.el --- Debian specific emacsen startup code.

;; Copyright (C) 1998 Rob Browning

;; Maintainer: Rob Browning <rlb@defaultvalue.org>

;;; Commentary:

;; This file contains startup code needed by all the various flavors
;; of Emacs for a Debian system.

;; next follow incomprehensible code then
redone code  because of comments that
"elisp doesn't appear to do tail recursion"
which seems unlikely from what I know of modern lisps...

; Rewritten to less elegant -- non recursive version because elisp
;; doesn't seem to handle tail recursion :<
(defun debian-unique-strings (strings)
  "Takes a list of strings and returns the list with *adjacent*
duplicates removed."
  (let ((result '()))
    (while (consp strings)
      (if (not (string= (car strings) (car (cdr strings))))
          (setq result (cons (car strings) result)))
      (setq strings (cdr strings)))
    (nreverse result)))

(defun debian-run-directories (&rest dirs)

  "Load each file of the form XXfilename.el or XXfilename.elc in any
of the dirs, where XX must be a number.  The files will be run in
alphabetical order.  If a file appears in more than one of the dirs,
then the earlier dir takes precedence, and a .elc file always
supercedes a .el file of the same name."

etc etc.

> Next, you can try Jari Aalto's tiny-load: http://tiny-tools.sourceforge.net/
> It loads packages during idle time. I use it in
> http://emacro.sourceforge.net/

Q: Am I going to have to rewrite this thing
?? :((( ?? using tiny-tools?  Over my head...

Has anyone else smarter than me already done this?

I clearly am way over my lisp head!

I thought maybe I was doing something really stupid in configuration,
such as
when I found that emacs was doing reverse dns lookup till it timed out
at 10 seconds which I fixed by adjusting /etc/hosts in my machine with
no dns.

Maybe there just a package or two that is screwed up that is delaying
my loading?
After all it is only loading 47 or so things. Emacs works fine on
another machine with only 16 things to load and 4seconds is a lot
longer  >>  3* almost nothing.. :).

Here in this excerpt of the full *Messages* buffer  given above,
we see some funny things

[2 times]
Error loading 55ecb etc.

vis:

 Loading semantic-idle (source)...done [2 times]
Loading ede-speedbar (source)...done
Loading 52semantic (source)...done
Loading 53cedet-contrib (source)...done
Loading 53cogre (source)...done
Loading 55ecb (source)...
"/usr/share/emacs21/site-lisp/cedet-common/" added to `load-path'
Error while loading 55ecb
Loading semantic-el (source)...done
For information about the GNU Project and its goals, type C-h C-p.
call-interactively: Beginning of buffer [14 times]
call-interactively: End of buffer


Dear Bruce your sourceforge site which I am looking at now is amazing.
I had no idea what a high level of emacs wizardry exists out in the
wild! 

Thanks


Mitchell

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: faster emacs startup, can I postpone package loading?
  2006-01-03  2:38 ` mitchell_laks
@ 2006-01-03  3:34   ` Ian Zimmerman
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Zimmerman @ 2006-01-03  3:34 UTC (permalink / raw)
  Cc: help-gnu-emacs


The files Emacs loads when starting up under Debian are in the
directories /etc/emacs*/site-start.d

Most of them are just stubs that add directories from which to load the
real library later, via the autoload mechanism.  So there's not much one
can cut there.

Some packages (the ones whose maintainers haven't bothered to read the
policy documents or look at best practices) have the performace bug of
loading real code at that time.  If you find this, just file a Debian
bug against the package.

This question would perhaps be better asked on the Debian specific list,
debian-emacsen@lists.debian.org

-- 
A true pessimist won't be discouraged by a little success.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* faster emacs startup, can I postpone package loading?
@ 2006-01-03 11:05 David Reitter
  0 siblings, 0 replies; 9+ messages in thread
From: David Reitter @ 2006-01-03 11:05 UTC (permalink / raw)
  Cc: Emacs help


[-- Attachment #1.1: Type: text/plain, Size: 561 bytes --]

> Is there some simple way that I can make all this (exciting) loading
> take place in the few seconds after I get my prompt and am working on
> my files?

Two techniques will serve that purpose.
Take a look at `autoload' (use the built-in documentation or Google),  
which loads packages when they are needed.

Also, you can load your stuff and dump a saved state. This is  
described in the Emacs (Lisp) Reference Manual, e.g. under "Building  
Emacs".
This will, however, only work for some packages and is probably going  
to be much more tricky for you.



[-- Attachment #1.2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2400 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: faster emacs startup, can I postpone package loading?
  2006-01-03  1:12 ` faster emacs startup, can I postpone package loading? BRUCE INGALLS
@ 2006-01-03 18:03   ` Kevin Rodgers
  0 siblings, 0 replies; 9+ messages in thread
From: Kevin Rodgers @ 2006-01-03 18:03 UTC (permalink / raw)


BRUCE INGALLS wrote:
>     From: "mitchell_laks" 
> 
>     Date: 2 Jan 2006 12:27:52 -0800
>     Subject: faster emacs startup, can I postpone package loading?
> 
>     On some of these systems the load process significantly slows down the
>     boot process. While emacs on some systems is immediately there, here it
>     can take 4 seconds (gasp).
> 
>  
> 
>     Now all this is by virtue of Debian packaging adding loads. I did not
>     really modify the .emacs file too much.
> 
> First, you'd have track down, where all the loading is happening.
> Perhaps this happens in a file like /usr/share/emacs/site-start/site-init.el

In which case the OP could start emacs with the --no-site-file command
line option.

-- 
Kevin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: faster emacs startup, can I postpone package loading?
@ 2006-01-04  0:10 BRUCE INGALLS
  0 siblings, 0 replies; 9+ messages in thread
From: BRUCE INGALLS @ 2006-01-04  0:10 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 2181 bytes --]

>
> From: "mitchell_laks"
> To: help-gnu-emacs@gnu.org
> Date: 2 Jan 2006 18:38:25 -0800
> Subject: Re: faster emacs startup, can I postpone package loading?
> > >
> > > First, you'd have track down, where all the loading is happening.
> > Perhaps this happens in a file like /usr/share/emacs/site-start/site-
> init.el
>
> Thank you! Bingo!
>
> The directories /usr/share/emacs and /usr/share/emacs21 are interesting
>
> There is a file debian-startup.el and the directories correspond to the
> things that emacs loaded during startup.

...

> There,  in the ../emacs21/.. directory
> the file is a compiled file .elc.
>
> But I can't read debian-startup.elc but I can read the
> debian-startup.el  in ../emacs/ .. :).
>
> ...


> Next, you can try Jari Aalto's tiny-load:
> http://tiny-tools.sourceforge.net/
> > It loads packages during idle time. I use it in
> > http://emacro.sourceforge.net/
>
> Q: Am I going to have to rewrite this thing
> ?? :((( ?? using tiny-tools?  Over my head...
>
> Has anyone else smarter than me already done this?
>
> Dear Bruce your sourceforge site which I am looking at now is amazing.
> I had no idea what a high level of emacs wizardry exists out in the
> wild!


Unfortunately, I do not have a  Debian system to test this on,  unless
Knoppix fits.
I appreciate the complement on EMacro. I believe that it is the oldest
package
dedicated to ease of Emacs use.
I am glad to see competition, i.e. more easy Emacs packages!
I've been devoting my recent time to polishing EMacro for serious
distribution.

You can see how I use tiny-load (grep is your friend) at the end of
e-config.el, as
well as in e-functions.el.
If the online help does not work for you, and there are no Linux User Groups
in your
area, nor a Linux Guru at work, then perhaps it is time to start a Hacking
Elisp
entry at http://www.emacswiki.org/

If all this still gives your neuron meltdown a senior moment, I have heard
of an open
source bounty site. Perhaps donating a recently completed tech textbook, or
a
SourceForge or Gnu contribution might motivate an alpha geek, here, on
Debian or
elsewhere...

[-- Attachment #1.2: Type: text/html, Size: 3108 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: faster emacs startup, can I postpone package loading?
  2006-01-02 20:27 mitchell_laks
  2006-01-02 21:40 ` Thorsten Bonow
@ 2006-01-06 13:56 ` kgold
  1 sibling, 0 replies; 9+ messages in thread
From: kgold @ 2006-01-06 13:56 UTC (permalink / raw)


"mitchell_laks" <mlaks2000@yahoo.com> writes:
> 
> Is there some simple way that I can make all this (exciting) loading
> take place in the few seconds after I get my prompt and am working on
> my files?

The recommended answer to this FAQ is to start emacs once when you log
in and then just keep it running as a server forever.  Edit new files
as a client.  It won't matter if emacs takes 2 or 10 seconds to load
when you do it twice a year.

See gnuserv/gnuclient or ???/emacsclient.

-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-01-06 13:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.21176.1136250882.20277.help-gnu-emacs@gnu.org>
2006-01-03  1:12 ` faster emacs startup, can I postpone package loading? BRUCE INGALLS
2006-01-03 18:03   ` Kevin Rodgers
2006-01-03  2:38 ` mitchell_laks
2006-01-03  3:34   ` Ian Zimmerman
2006-01-04  0:10 BRUCE INGALLS
  -- strict thread matches above, loose matches on Subject: below --
2006-01-03 11:05 David Reitter
2006-01-02 20:27 mitchell_laks
2006-01-02 21:40 ` Thorsten Bonow
2006-01-06 13:56 ` kgold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).