Re: To Discuss: Application Startup Time

On Mon, Mar 29, 2004 at 10:27:39AM +0200, Alexander Larsson wrote:
> On Sat, 2004-03-27 at 18:13, Andy Ross wrote:
> > I'd suggest the initial work just eliminate the giant directory
> > crawl, and simply do something like:
> > 
> >   stat("/first/path/to/search/my-icon");
> >   stat("/second/path/to/search/my-icon");
> >   stat("/third/path/to/search/my-icon");
> >   ...
> > 
> > ...until it finds the file.  This is what bash does when searching the
> > PATH for executables, and I've never heard complaints.  This would
> > provide an immediate speedup without the need for any annoying on-disk
> > indexing.  The index idea could be revived if this was still too slow.
> Yes. But bash only does it once, and only on direct user input where a
> few stats are not visible. Do the stats a few thousand times when
> reading a directory and you'll slow the desktop down to a crawl.
> However, maybe we could populate the caches as needed when doing the
> stats. It'd be slower than the readdirs() if an app needs all icons, but
> might be better if you only use a few of them. Needs some testing.

I don't see that helping enourmously.  Apps are going to be looking
up icons on startup, so we end up doing a fair number of stats on
the critical path.

Some sort of pre-built icon registry for themes seems like a better
direction to go in.  Adding/Removing icons from themes is not as
frequent an event as running the applciations.  Rather than doing a
straight 'install foo <themedir>' a helper app that could maintain a
pango/gdk style compilation would work.  A fontconfig style cache
could also work.  Heck we could even get fancy and preload all the
icons in a theme into a shared lib automagicly.

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