[sugar] rendering test

Bernie Innocenti bernie
Sun Sep 28 12:35:22 EDT 2008


Benjamin Berg wrote:
> On Sun, 2008-09-28 at 12:43 +0200, Riccardo Lucchese wrote:
>> Besides this, I think the icon caching mechanism should be reworked:
>> right now every icon has its own surfaces-cache and its svgloader. So
>> that, if I'm not wrong, two icons showing the same svg (with same size,
>> colors etc..) cache two distinct but identical surfaces in their
>> _iconbuffer and cache two times the raw svg file contents in their
>> svgloader.
> 
> The cached surface is shared between different icons (the icon buffer is
> not shared). _surface_cache is a class variable, so that only one LRU
> list for the surfaces is created.

That was my impression too.  On the train from Brno to Prague, me and 
Tomeu made some quick & dirty performance measurements on that code.

IIRC, on startup we render something like 30 svg icons, and blit them to 
screen around 60 times after the home view is fully rendered.  Switching 
views does not cause too much rendering too.

While I might have a fuzzy memory for the exact numbers, I'm damn sure my 
conclusion was that there wasn't much to be gained by optimizing icon 
rendering.

There were, however, a couple of icons with too many vertexes.  These 
would take 10x the time of other average icons to render.  One of these 
was the Tortoise icon, perhaps Tomeu remembers the other one.


>> I guess best would be switching to have only one global cache (or
>> not ? ;); perhaps a global cache clashes with using server side
>> surfaces ? (see benzea's patches)
> 
> A shared cache would be great. One way to do it would be to share a
> mmap'able file similar to the GTK+ icon cache file. But to create this
> file, one will need to know the icon colors that should be prerendered.
>  
> More complicated would be to create a small service that uploads
> rendered icons to the X server, and hands back the pixmap ID. That way
> all applications could use one shared server side cache.
> (The pixmap based sapwood GTK+ engine, used on the Nokia 770/8x0
> devices, does this to save memory.)

We discussed this approach in Brno.  I'm glad to hear it's feasible.

Oh, why can't we just use the gtk icon cache with the rendered pixmaps?

-- 
    \___/  Bernie Innocenti - http://www.codewiz.org/
   _| X |  Sugar Labs Team  - http://www.sugarlabs.org/
   \|_O_|  "It's an education project, not a laptop project!"



More information about the Sugar-devel mailing list