Re: Gtk icons caching



On Wed, 2005-04-06 at 11:17 +0200, Jacob Kroon wrote:
> I've straced a few Gtk-applications, and noticed a behaviour I wanna
> inquery about. I am running Fedora Rawhide, which includes Gtk+ 2.6.4 as
> of 2005-04-06, and what is bothering me is the icon "cache" or whatever
> the thing that handles icon rendering. Using Firefox it takes about a
> second to open the menues the first time, and stracing seems to show
> that this is due to stat64():ing all of the current Gtk-themes icons.
> This seems to be a general behaviour for all Gtk-applications.
> Applications which do not render any icons never have to do the
> stat64()-thing it seems, and thus starts a hell of a lot faster on my 
> system, which honestly is quite dated.

> So my question is, couldn't the stat64-thing be made
> application-independent, so that this is done only once, when the
> Gtk-library is first initiated by a running application, so that
> subsequent Gtk-applications wouldnt have to go through the same process?
> 
> Now, I am not a Gtk-expert in any way, so I already now apologize for
> any incorrect statements in this mail, I can't even tell if this really 
> is the bottleneck, I am just curious.
> 

GTK+ already supports exactly what you describe. I can use of mmapped 
cache files for icon themes. Do you have files called
/usr/share/icons/<themename>/icon-theme.cache ?
Are they uptodate, ie not older than the directory containing them ?

If you are missing them, or they are stale, try running

for d in /usr/share/icons/*; do gtk-update-icon-theme -f $d; done

Matthias




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