[cairo] Global glyph cache

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 6 06:19:45 PST 2009

On Wed, 2009-03-04 at 16:42 -0500, Jeff Muizelaar wrote:
> Where did you see this big win?

Running gnome-terminal with drm, the overhead in the scaled-glyph cache
is significant. Profiling the text perf cases, the split is roughly 1/3
in index lookup, 1/3 in glyph lookup and 1/3 elsewhere (i.e creating and
feeding the batch buffers, pushing images, with about 10% in the kernel
executing the batch). The danger inherent in our perf-suite is apparent
since that test is entirely ASCII. (gnome-terminal is a little better,
but again the majority of the glyphs are acknowledged to be ascii.)

> The tp run that I posted a link to uses
> an average of about 5.9 glyphs per page. With an english browsing
> session I get an average of 27.5 and a chinese browsing session I get 4.4.
> (data and scripts at http://people.mozilla.org/~jmuizelaar/glyph-cache/)

Hmm, need to look through this data as well. But that seems similar to
results from the tp run you posted earlier. Playing about with a few
scenarios, the first result seems to be that we can achieve a good hit
rate just keeping a small hash (~32 glyphs) of recently used glyphs.

It also seems the spatial clustering within fonts is not dense enough to
justify allocating linear pages of glyphs at a time. So at the moment it
looks like its back to the drawing board.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot.png
Type: image/png
Size: 7862 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20090306/371acb34/attachment.png 

More information about the cairo mailing list