[cairo] text measurement in perf?

Carl Worth cworth at cworth.org
Thu May 31 11:23:20 PDT 2007


On Tue, 29 May 2007 17:25:54 -0400, Behdad Esfahbod wrote:
> Western scripts).  Not sure how to fix this without regressing.  Xft has
> a global cache size limit and a per-font one, and uses a global glyph
> cache.  Cairo used to be similar but Keith rewrote it to use per-font
> glyph cache.  We probably should make it adaptive.

Note that the rewrite was not for this reason. It was a general
cleanup of some messy/broken code and the 256-entry per-font caching
was just something easy to understand and make correct, (never
intended to be the thing that would perform well).

I've talked with Keith about the issue, and I think we really do want
to have a global cache with random replacement across all fonts,
(perhaps appropriately weighted so that larger glyphs are more likely
to be replaced than smaller glyphs). So we basically want a style
similar to what Xft does, but we can change the details, (I think Xft
tries to hard to make the replacement strategy perfectly fair and
wastes time doing that---we could do something faster that merely
approximates the fairness).

I'll let Keith fill in more details here on the lessons he learned
from the Xft implementation if he has them.

So I'd really like to see cairo's glyph cache get to the point where
there's basically just a single parameter controlling the total size of
the cache, (and similarly for other things that cairo caches). Then it
would be reasonable for embedded systems to tune those parameters at
compile-time, and we could even think about run-time mechanisms for
tuning the parameters as well if that makes sense.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://cairographics.org/archives/cairo/attachments/20070531/5cba15b9/attachment.pgp 


More information about the cairo mailing list