[cairo] Text layout speed in roadster -> font cache needed in cairo

Keith Packard keithp at keithp.com
Mon Mar 14 20:41:48 PST 2005


I looked into why text drawing was so amazingly slow in roadster and 
discovered that it was setting the font each time it measured a string.
This caused cairo to call down to fontconfig to match the font, open the 
font file, load the font and measure the string.  As 'cairo_restore' was 
called immediately after drawing the string, the carefully constructed 
font was discarded only to be immediately regenerated for the next string.

Moving the font selection all the way outside the label computation so 
that it was done once per layer instead of once per label provided a huge 
speed up.

It would be nice if cairo would do a bit of font caching to avoid all of 
this.

-keith


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050314/ad6a9e27/attachment.pgp


More information about the cairo mailing list