[cairo] text measurement in perf?

Baz brian.ewins at gmail.com
Fri May 25 16:21:41 PDT 2007


Text measurement on the mac is a bit better now :) ...

quartz-rgba              glyph-extents-100  300.19 9.11% ->  45.77
1.30%:  6.31x speedup
quartz-rgb               glyph-extents-100  297.16 2.89% ->  45.40
0.39%:  6.20x speedup
(this is the test I described in the previous mail)

the big figures from the profile... before:
47.8% _cairo_atsui_font_scaled_glyph_init
26.1% _cairo_cache_insert
24.5% _cairo_hash_table_insert

and after the fix:
43.8% _cairo_cache_insert
41.2% _cairo_hash_table_insert
13.5% _cairo_atsui_font_scaled_glyph_init (10%
ATSGlyphGetScreenMetrics, 3% transforms)

Not much fat left to cut there. We could probably transform less here,
I scale from device extents to user extents, then cairo scales them
back in cairo_scaled_font.c . Not very high on the profile though.

On 25/05/07, Baz <brian.ewins at gmail.com> wrote:
> Hi,
> I'm hoping to tackle some of the issues firefox have with slow text
> measurement on the mac[1] this weekend. I've got a fix in mind, but
> perf-diff isn't going to notice it - the 'text' perf test renders
> parts of the same string repeatedly and won't ask for a lot of glyph
> measurements.
>
> I think I want to add a perf test for glyph-extents (rather than
> text-extents, since programs using the 'real' font api will do
> text-to-glyphs for themselves). I was thinking of taking chunks of of,
> eg, 100 glyphs at a time, filling the glyph array with sequential
> glyph ids modulo some largish number - so I'm not always hitting the
> cache - and not bothering to render the text at all.
>
> Does this sound reasonable? Any better ideas before I head home and code this?
>
> -Baz
>
> [1] http://weblogs.mozillazine.org/roc/archives/2007/05/the_glyph_bound.html
>


More information about the cairo mailing list