[cairo] Profiling the slowness of xlib surface
Timothée Lecomte
timothee.lecomte at ens.fr
Thu Apr 20 10:38:49 PDT 2006
Hi all !
For my gnuplot terminal based on Cairo, I use a temporary surface where I
draw thousands of adjacent polygons with CAIRO_OPERATOR_SATURATE, and then
I use the result as a source pattern to paint the main context.
This process works quite well with both image surfaces, but is somewhat slow.
But it is even worse if my main surface is a xlib surface, obtained by
gtk_cairo_create(my_offscreen_pixmap).
If I create my temporary surface with cairo_surface_create_similar(), I
get the artifacts as reported in a previous post (thread "avoiding
seams").
If I create the temporary surface with cairo_image_surface_create(), the
output is correct.
In both cases, the process is twice as slow compaired to the pure 'image
surface' case.
To track the slowness, I used sysprof to make a profile of the system calls.
I use xorg 6.9, on a radeon, without the composite extension, and without
EXA.
Here are the results :
* final and temporary image surface : 55% of the time spent on fbCopyAreammx
* final xlib surface, temporary image surface : idem
* final and temporary xlib surface : 46 % of the time spent on
fbCompositeSrc_8888x8888mmx
You can find the sysprof profiles here (you can open them in sysprof to
see the tree of calls) :
http://tipote.free.fr/profile_image_image
http://tipote.free.fr/profile_xlib_image
http://tipote.free.fr/profile_xlib_xlib
I don't know if something can be done, but it is somewhat discouraging to
see that a pure image surface is faster than a xlib one. Does it mean that
pixman uses X to render ?
Can I do something to improve this situation ?
Thanks for your help, and for the great work done on Cairo.
Regards,
Timothée Lecomte
More information about the cairo
mailing list