[cairo] Text performance on windows?

Vladimir Vukicevic vladimir at pobox.com
Tue Sep 9 00:39:38 PDT 2008


Hi Damian,

On Aug 26, 2008, at 10:38 AM, Damian Frank wrote:

> By the way, I apologize for the email volume, but I wanted to attach  
> my latest performance tests.  These are based on a quick and dirty  
> "render as many glyphs as possible in one second" test, using the  
> same string at the same position, run on a 2GHz Core 2 Duo.  gdi,  
> d3d, and gdi+ refer to other back-ends we have already implemented,  
> performing the same operations.  This benchmark should only include  
> time spent rendering text, not swapping buffers or anything like that.
>
> I find it quite interesting that dib is faster than ddb.  In  
> particular, the ExtTextOutW call is tremendously slower, and yet the  
> DDB case seems to incur much more overhead in  
> cairo_gstate_show_text_glyps for the DDB case.  Is this to be  
> expected?
>
> Running a render-as-many-glyphs-in-1-sec-as-possible test:
>  cairo ddb:     90K g/s
>  cairo dib24:  114K g/s
>  cairo dib32:   66K g/s
>  cairo image:   75K g/s
>  gdi:          965K g/s
>  d3d:           49K g/s
>  gdi+:         432K g/s

Is the code for this something that you can share?  (I can write my  
own, but want to avoid redoing the work if at all possible.)  I'm  
guessing it does something like:

do_cairo_setup();

for (int i = 0; i < bignum; i++) {
    cairo_show_glyphs (cr, glyphs, nglyphs);
}

And times the loop?  (Want to make sure that you're not using  
show_text or similar.)  And for the pure GDI case, you're just calling  
ExtTextOutW, ideally with ETO_GLYPH_INDEX?

We should be able to get things as fast as GDI -- Mozilla is going  
through Cairo for almost all text rendering, and we're seeing speeds  
that are comparable to what our previous direct-to-GDI path was doing.

     - Vlad



More information about the cairo mailing list