[cairo] Cairo 1.3 performance loss

Jorn Baayen jorn at openedhand.com
Wed Jan 24 05:48:55 PST 2007


Hi,

Comparing cairo 1.2.4 and 1.3.12 on ARM, a performance loss of 2% is
observed when drawing GTK+ widgets[1]. 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[2], 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
expectations?

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.

Regards,

Jorn

[1] http://folks.o-hand.com/~jorn/cairo-benchmarks/

    The test is an empty GtkEntry (or non-empty GtkLabel) being
    repeatedly redrawn for one minute. The number of draws is then
    reported.

    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.

[2]
http://mail.gnome.org/archives/performance-list/2006-October/msg00033.html

-- 
OpenedHand Ltd.
http://o-hand.com/



More information about the cairo mailing list