[cairo] [PATCH] scaled-font: fine-tune caching
Chris Wilson
chris at chris-wilson.co.uk
Mon Jun 14 07:49:35 PDT 2010
On Mon, 14 Jun 2010 16:40:39 +0300, Dmitri Vorobiev <dmitri.vorobiev at movial.com> wrote:
> This patch implements the ideas outlined by Behdad Esfahbod in the following
> mailing list message:
>
> http://lists.cairographics.org/archives/cairo/2010-June/020065.html
>
> Specifically, two things have been adjusted. First, the size of the look-up
> table was reduced to 64. Second, cache codepath is now bypassed for strings
> that are shorter than 16, not only for one-character strings. This allowed
> us to reduce the LUT initialization overhead while still retaining the
> advantage of caching for common-case string sizes.
>
> We have experimented with different LUT sizes, and it came out that the size
> of 64 is the best one in view of speed, at least for our language-neutral
> benchmark, which generated random strings of printable ASCII characters.
Thanks for taking the time to do an interesting analysis of the advantages
and disadvantages of trying to avoid the hash table lookup. I still feel
slightly dubious by measuring performance of random ASCII characters as
opposed to a set of strings harvested from application usage. However,
some analysis is far better than none - pushed.
-ickle
--
Chris Wilson, Intel Open Source Technology Centre
More information about the cairo
mailing list