[Sugar-devel] feature freeze issue #1: icon cache

Benjamin Berg benjamin at sipsolutions.net
Sat Jan 17 07:33:42 EST 2009


On Sat, 2009-01-17 at 12:49 +0100, Tomeu Vizoso wrote:
> http://dev.laptop.org/ticket/8822 - Create an mmap'able icon cache
> 
> Without this new feature, we have a limited size cache kept in memory.
> Meaning that icons need to be fully rendered the first time that are
> shown in the UI and that once we exceed the cache limit, we'll be
> doing very expensive computations at every UI redraw.
> 
> Would like to hear opinions about having to commit it in this release
> or being able to wait for the next one.

As the author of the patch, here some information on it (the ticket is
pretty a bit loaded in some ways).

Currently Sugar will keep the last 50 icons in the cache. Where each
color combination needs to be cached separately. This is fast as long as
there is a cache hit, but should you have a full friends and activities
view for example, 50 icons will not be enough.

The icon cache patch attached to the ticket, would change this
completely. The cache will usually store two masks of each sugar icon at
different sizes (works for every icon that only use the "stroke" and
"fill" colours). With this data it is possible to draw any colour
combination of an icon directly from the cache. Icons that contain more
colors, will currently be redrawn each time.

Advantages:
 * One mmaped cache, that is shared between activities
   (and file backed).
 * Cached icons work for *any* color combination

Disadvantages:
 * If the correct size is not in the cache, the icon need to be scaled
   (This will happen with a relatively large number of icons in the
   activity ring view.)
 * Drawing speed from the cache is lower
 * Icon cache needs to be build/rebuild
   * On installation of sugar-artwork (for the icon theme)
   * On first startup
   * When activities are installed

Benjamin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20090117/9e08692b/attachment.pgp 


More information about the Sugar-devel mailing list