[cairo] Text performance on windows?

Damian Frank damian.frank at gmail.com
Wed Sep 10 17:52:13 PDT 2008


On Tue, Sep 9, 2008 at 2:39 AM, Vladimir Vukicevic <vladimir at pobox.com> wrote:
> 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?

Unfortunately I can't share, both because of licensing and because of
the excessive complexity of the software.  However, it essentially
does that, except it's time-based.  The other important difference is
that we *are* using show_text for testing purposes.  Here are some of
the timings breaking the overhead down a little bit.  cairo_show_text
represents time spent in the whole routine, and c_gs_* breaks it down
into those two routines alone.

As for our GDI comparison, yes, we have a text layout engine of our
own and we do the rendering with ETO_GLYPH_INDEX.

Some timings using QueryPerformanceCounter:
ddb:
         ExtTextOutW: last:      8 avg:    8.5  min:      6  max:   2163
     cairo_show_text: last:    969 avg: 1012.6  min:    833  max:  86489
 c_gs_text_to_glyphs: last:    404 avg:  431.7  min:    385  max:  85762
 c_gs_show_tx_glyphs: last:    540 avg:  555.0  min:    420  max:  58285

dib24:
         ExtTextOutW: last:    222 avg:  247.7  min:    198  max:  15359
     cairo_show_text: last:    737 avg:  786.3  min:    709  max:  15064
 c_gs_text_to_glyphs: last:    394 avg:  427.7  min:    384  max:  11327
 c_gs_show_tx_glyphs: last:    314 avg:  332.8  min:    297  max:   9396

dib32:
     cairo_show_text: last:   1203 avg: 1294.8  min:   1167  max:   9301
 c_gs_text_to_glyphs: last:    397 avg:  430.3  min:    384  max:   5215
 c_gs_show_tx_glyphs: last:    782 avg:  839.5  min:    754  max:   7481

image:
     cairo_show_text: last:   1073 avg: 1145.6  min:   1051  max:  51262
 c_gs_text_to_glyphs: last:    387 avg:  406.0  min:    383  max:   3776
 c_gs_show_tx_glyphs: last:    662 avg:  715.1  min:    640  max:  50815


Thanks for your help.  If you have any trouble reproducing the
performance, I'm willing to try to reproduce what we do in a simpler C
program.

Damian


More information about the cairo mailing list