[cairo] Where's the bottleneck in using glitz/cairo/librsvg?

Dominic Lachowicz domlachowicz at gmail.com
Tue Jun 6 20:25:59 PDT 2006


Hi Mirco,

I added 2 g_prints to your code, just to see how often librsvg was
being invoked:

line 165: g_print("rendering %s scaled to cairo\n",
g_aIcons[iElement].acFileName);
line 181: g_print("rendering %s unscaled to cairo\n",
g_aIcons[iElement].acFileName);

It's startling how many times these get called. All of the icons are
re-rendered every time the mouse moves. They are re-rendered even if
the SVGs in question wouldn't rescale.

Also, if there are a finite number of zoom percentages, it might be
worthwhile to pre-render the SVGs to cairo_surface_t's and then
set_source_surface()/cairo_paint() those.

I'd say that excessive rendering is your bottleneck. It might be worth
investigating Federico's "limiting your repaint rate" blog entry, as
well as only redrawing the SVGs dirtied by the motion-notify event.

http://primates.ximian.com/~federico/news-2006-04.html#limiting-your-repaint-rate

Best,
Dom

On 6/6/06, Mirco Müller <macslow at bangang.de> wrote:
> Greetings everybody!
>
>         Trying to achieve crisp animated graphics I encountered an unexpected
> CPU-hogging. Have a look at this blog-entry...
>
>         http://macslow.thepimp.net/?p=58
>
>         You'll find example-code, a sysprof-log and screencasts of the issue at
> hand. While it looks like librsvg to be the "bottleneck", I would like
> to hear opinions of others on this, who are more experienced with
> profiling-work and have a deeper knowledge of glitz, cairo and librsvg.
>
> Thanks in advance for your help!
>
> Best regards...
>
> Mirco "MacSlow" Müller
>
> --
> email - macslow at bangang.de
> www - http://macslow.thepimp.net
> lowfat - http://macslow.thepimp.net/sponsor-it
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
>


-- 
Counting bodies like sheep to the rhythm of the war drums.


More information about the cairo mailing list