[cairo] Cairo 1.3 performance loss
jorn at openedhand.com
Wed Jan 24 05:48:55 PST 2007
Comparing cairo 1.2.4 and 1.3.12 on ARM, a performance loss of 2% is
observed when drawing GTK+ widgets. On closer inspection, it turns
out that the new tessellator may be to blame.
Whereas _cairo_traps_tessellate_polygon() takes up 0.17% of the overall
system profile (1.9% in the cairo profile) in 1.2.4,
_cairo_bentley_ottmann_tessellate_polygon() takes up 0.54% of the
overall system profile (7.1% in the cairo profile) in 1.3.12.
As suggested earlier, I added counters to _line_segs_intersect_ceil()
in 1.2.4 and to _cairo_bo_edge_intersect() in 1.3.12. It turns out that,
per widget draw, _line_segs_intersect_ceil() is called 4 times, but
_cairo_bo_edge_intersect() 7 times. Is this 75% increase according to
I suspect that the decrease in tessellator performance is responsible
for more than the observed 2% slowdown, as 1.3 contains many
optimizations that are not in 1.2.
The test is an empty GtkEntry (or non-empty GtkLabel) being
repeatedly redrawn for one minute. The number of draws is then
For the cairo tests, GTK+ 2.10.6 was used. For the non-cairo tests,
GTK+ 2.6.7 was used. In both cases the built-in Default theme was
used to draw the widgets.
More information about the cairo