Re: Removing xrdb for 10% startup win?



On Sat, 2005-08-27 at 18:09 +0200, Lorenzo Colitti wrote:
> Hi,
> 
> For my Summer of Code project (mentor: Owen Taylor) I am working on 
> improving gnome startup time. Proof-of-concept work on gconf has already 
> succeded in reducing boot time from ~35 to ~20 seconds, showing that 
> there is room for improvement.
> 
> Moving down the list of top culprits, my benchmarks show that xrdb (and 
> the cpp it spawns) to be one of the worst, and indeed symlinking xrdb to 
> /bin/true results in a ~10% reduction in startup time.
> 
> xrdb is called by gnome-settings-daemon in order to make the colours of 
> X applications match the standard GTK theme and to merge in user 
> settings from .Xdefaults, .Xresources and .gnome2/xrdb/* :
> 
> http://cvs.gnome.org/viewcvs/gnome-control-center/gnome-settings-daemon/gnome-settings-xrdb.c?rev=1.5&view=markup 

One thing to be noted is that we only get a significant win if we 
avoid calling xrdb (and thus cpp) *at all*. If you trace, say, the 
Fedora startup process, xrdb is first called by the X init scripts,
then later *again* by gnome-settings-daemon.

xrdb is also invoked by the default GNOME Xsession script:
 
  http://cvs.gnome.org/viewcvs/gdm2/config/Xsession.in?view=markup

I'm guessing that possibly Lorenzo didn't have any of these files
in his test setup. (Fedora always has a system Xresources file. I don't
know the situation for other distributions.)

Since it looks like the main expense of Xrdb is paging the gcc binary
into memory, calling it twice is not a lot more expensive than
calling it once. 

cpp is built into GCC these days, so is not lightweight by any means.

I don't know if there is a 10k cpp implementation out there, but if
there is, then switching X.org to use that might by the right course in
this area.

To put it another way - we don't get the win by just removing
grdb, we need to get rid of xrdb calling cpp altogether.

Regards,
					Owen

Attachment: signature.asc
Description: This is a digitally signed message part



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