emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reducing emacs size by more frequent garbage-collect in loadup.el


From: Dan Nicolaescu
Subject: Re: reducing emacs size by more frequent garbage-collect in loadup.el
Date: Sun, 26 Jul 2009 15:19:35 -0700 (PDT)

Ken Raeburn <address@hidden> writes:

  > On Jul 26, 2009, at 14:57, Dan Nicolaescu wrote:
  > >> Another way to win similar improvements might be to lower the value
  > >> of
  > >> gc-cons-threshold and friends during loadup.el.
  > >
  > > This sounds like it's a bit more complicated...
  > 
  > It should just take a 'let' binding around most of the interesting
  > parts of loadup.el.  (Or setq, if you don't mind not recovering the
  > default value set in C code.)  So it means reindenting, but not
  > dropping in lots of explicit GC calls.  It also means GC will run more
  > frequently during loads, instead of in between.  There's also a lower
  > limit, below which gc-cons-threshold will be reset during GC.  So the
  > impact in time and space may be quite different.
  > 
  > I'd also be surprised if there didn't turn out to be one or two
  > strategic places in loadup.el where you could insert GC calls and get
  > back quite a portion of that 2%.  In the early parts of the process,
  > where most of the garbage slots generated are likely to be filled by
  > files loaded later, doing extra GC passes just seems like wasted work.

Given that the time it takes is in the noise, it doesn't really matter.
I'm a bit uneasy about that approach because setting the gc thresholds
might to be adjusted from time to time.  And also we have never run with
different thresholds during dumping and during normal usage, so that
might be a small risk too.

Whereas just adding a gc call after each load will not need any extra
maintenance.  When new files are added, it's obvious to the person that
does the addition that there's a need to add a gc call too.

  > On the other hand, I would expect that 2% savings in file size is
  > mainly just saving disk space; 

Yes, this is about saving disk space, and it can be done with minimum
work and no extra future maintenance.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]