[cairo] [PATCH] scaled-font: optimize cairo_scaled_font_text_to_glyphs()
chris at chris-wilson.co.uk
Wed Jun 9 15:14:19 PDT 2010
On Wed, 09 Jun 2010 14:38:38 -0400, Behdad Esfahbod <behdad at behdad.org> wrote:
> Perhaps I should dig into the git history to find what were the supporting
> numbers when the cache was added in the first place. Appreciate any pointers
> (Chris added this I assume).
Naughty me, I didn't log them, I remember working on the basis of a 30%
cache hit rate, which was enough to cover its cost. The direct cache is
there to simply reduce the overhead of the hash table scaled glyph lookup.
I've trimmed little bits off the cost of glyph init and other overhead
during the lookup, not a lot but measurable (if only with callgrind at
times) but I've yet to find a quicker ht. Some of the techniques to stuff
a few bits of the hash into the pointer look promising, but the chain
length is usually so short that I haven't even bothered experimenting. All
improvement is gratefully accepted, even an outright removal if the lookup
is fast enough to stand on its own -- which is my primarily reason for
capturing the benchmarks in use.
Chris Wilson, Intel Open Source Technology Centre
More information about the cairo