Imlib cache and GNOME




Hello guys,

   During the heated debate yesterday, perhaps all of the important
information regarding the Imlib cache and GNOME was lost in the noise. 
And there is a huge confussion as to what the status is right now.

* Executive summary

   The problem is solved.  People running the Pixmap engine will run
at full speed.  People who do not use the Pixmap engine will still get
their memory preserved.

If you care about the details, here they are:

* The problem:

   The Imlib-based Pixmap theme was running very slow for GNOME
applications.  The reason is that GNOME in an attempt to minimize
memory usage turned off the Imlib cache for pixmaps in the application
according to a ~/.gnome/Gnome setting which defaults to "turn off
cache".

* The fix

   Imlib provides a _get_cache_info and a _set_cache_info functions
that allow applications to query the cache control and set the cache
control.  

   Now, the Pixmap theme will always turn on the cache (as it has been
shown it improves performance).  

   Since the Pixmap theme might be initialized before GNOME
initializes, the Pixmap theme "hints" the GNOME startup code that a
heavy user of Pixmaps is running and that it would be really stupid to
turn this off.

   The GNOME startup code will acknowledge this setting and will not
turn off the Imlib cache in this situation. 

   This fix is implemented in two parts (and has been in CVS for about
36 hours now):

gtk-engines/pixmap-theme, theme initialization:

	gdk_imlib_set_cache_info (-1, -1)

-1 is a true value from Imlib's point of view, and differs from the
default "1" value (which is the hint we pass to GNOME).

gnome-libs/libgnomeui/gnome-init.c (gnome_init_cb);

       If the cache_info is set to -1, -1, then ignore completely our
[Cache]Disable_Imlib_cache setting.

* Results

    Since few GNOME applications make use of the most sofisticated
featueres of Imlib, by default GNOME will run with little memory
wastage. 

    Users of the Pixmap theme will always have their cache turned on.

* Strange side effects

   This solution is not perfect.  If the user goes from PixmapTheme to
a plain theme, the cache will not be turned off until the application
is restarted.

* Conclusion

   I think this solution is good enough and should address everybody's
concerns.  While not conceptually clean, the next major version of
GNOME (1.2) will include a proper fix.

Miguel.



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