[cairo] Global glyph cache
jeff at infidigm.net
Wed Mar 4 13:42:27 PST 2009
On Wed, Mar 04, 2009 at 08:22:26AM +0000, Chris Wilson wrote:
> > Looking through the code this seems expected. Given a cache page size of
> > 17936 bytes we can get up 512*17936 = 9183232 bytes in the cache. In
> > addition, we could have glyph pages attached to scaled_fonts which would
> > add another 256 pages bringing the maximum up to 13795584 or 13.1 MB.
> That's a valid assessment for cairo's internal caching, but an
> underestimate since firefox maintains a much larger font cache.
This could likely account for what I thought were bugs with the
> > It also looks like some of the cache freezing/thawing might be broken
> > because even after adjusting MAX_GLYPH_PAGES_CACHED to 2 I've still seen
> > around 400 active glyph pages during a tp run.
> I'd love to get my hands on a cairo-trace for a tp run. My firefox usage
> doesn't even come close. On that subject, would we be able to
> redistribute such a benchmark along with cairo-perf? I really want to
> complement our collection of mostly synthetic perf cases with a few
> complex real-world tests.
I'm not sure how distributable a cairo-trace of a tp run would be. The
tp pageset is basically the content of the top 400 or so pages, which
isn't really distributable.
> For the global glyph cache there are two tuneables; number of
> glyph-per-page and number of pages in global cache (ignoring any
> apparent bugs ;-).
> Using the spatial clustering of glyph indices is a big win (keeping the
> mru page bypasses most glyph cache lookups.
Where did you see this big win? 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/)
More information about the cairo