[cairo] Cairo 1.3 performance loss

Jorn Baayen jorn at openedhand.com
Wed Jan 31 08:00:49 PST 2007


Hi,

On Tue, 2007-01-30 at 18:00 -0500, Behdad Esfahbod wrote:
> On Tue, 2007-01-30 at 17:02 -0500, Daniel Amelang wrote:
> > On 1/30/07, Jorn Baayen <jorn at openedhand.com> wrote:
> > > 1.3.8 sees a 1.15x text drawing speedup wrt 1.3.6 (which performs about
> > > the same as 1.2.4) -- probably due to Behdad's show_glyphs rework. With
> > > 1.3.10 text drawing sees a 0.89x slowdown. I'll trace down what exactly
> > > causes this (hopefully) tomorrow.
> > 
> > One thing comes to mind: Behdad fixed a bug in 1.3.10 (I think) that
> > added an extra check before enabling a show_glyphs optimization (in
> > cairo-gstate somewhere). It is possible that the 1.3.6 was faster
> > because it used this optimization where it really shouldn't have.
> 
> I believe you mean this:
> 
> @@ -1588,7 +1588,8 @@ _cairo_gstate_transform_glyphs_to_backend (cairo_gstate_t      *gstate,
>      cairo_matrix_t *device_transform = &gstate->target->device_transform;
>  
>      if (_cairo_matrix_is_identity (ctm) &&
> -        _cairo_matrix_is_identity (device_transform))
> +        _cairo_matrix_is_identity (device_transform) &&
> +	gstate->font_matrix.x0 == 0 && gstate->font_matrix.y0 == 0)
>      {
>          memcpy (transformed_glyphs, glyphs, num_glyphs * sizeof (cairo_glyph_t));
>      }
> 
> 
> This shouldn't have any impact in typical uses, as font matrices with
> non-zero translation are not used in Pango at all.
> 
> The only other change between 1.3.8 and 1.3.10 I see that *may* have any
> impact is Carl's optimization for rectilinear strokes, but I really
> doubt that's what you're looking for.
> 
> Can you retest?

Today I wrote a little tool, similar to cairo-perf but timing repeated
draws instead of single ones. This, contrary to cairo-perf (which
depends on a timer granularity that is not available on the machine I
test on), is producing useful output on this ARM here. 

Source + results: http://folks.o-hand.com/jorn/cairo-benchmarks-2/

In short, this shows a more or less steady performance improvement from
1.2.4 all the way up to 1.3.12. Let's hope these figures are more
trustworthy.

Still, it would be interesting to see what adding a rectangle primitive
does, as the tessellate function in 1.3.12 does get called more than the
one in 1.2.4. Also the data seems to suggest that filling rectangles is
slightly faster using 1.2.4 than using 1.3.x.

Thanks for all the help and patience,

Jorn

> 
> 
> > Sorry for not providing specifics. I have to take off right now. I can
> > get you more later if you need it.
> > 
> > Dan
> > _______________________________________________
> > cairo mailing list
> > cairo at cairographics.org
> > http://cairographics.org/cgi-bin/mailman/listinfo/cairo
-- 
OpenedHand Ltd.
http://o-hand.com/



More information about the cairo mailing list