[cairo] text measurement in perf?

Behdad Esfahbod behdad at behdad.org
Tue May 29 14:25:54 PDT 2007


On Tue, 2007-05-29 at 15:49 -0500, Federico Mena Quintero wrote:
> On Mon, 2007-05-28 at 20:52 -0400, Behdad Esfahbod wrote:
> 
> > The issue with non-Western languages you identify is very real, and
> > Federico identified that cairo-1.2 is more than an order of magnitude
> > slower than cairo-1.0 when dropped a huge bunch of Chinese/Japanese text
> > at (in his GUADEC 2006 keynote where he first finger-pointed me as his
> > hero, then next slide revealed the huge regression and everyone was
> > turning heads to see who I was..., hehe).  The change that caused it of
> > course was moving from a global glyph cache to a 256-per-font one.
> > Again, Carl has thoughts about how to fix that too.  Carl?
> 
> It was parallax error; for the culprit I was actually pointing at
> KeithP ;)
> 
> I didn't get around to seeing where the problem lies, but Keith
> mentioned that it may be the changes in *fontconfig's* cache, not
> Cairo's.  (Or was that Freetype...?)

No, it's definitely cairo.

> Some interesting links:
> 
> Character frequencies in Chinese: 
> http://lingua.mtsu.edu/chinese-computing/statistics/char/list.php?Which=MO
> 
> Most common bigrams:
> http://lingua.mtsu.edu/chinese-computing/statistics/bigram/form.php

Seems like for both Chinese and Japanese a cache of around 2000
character is more than enough (same way that 256 is more than enough for
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.  I need to do similar
things in Pango too, so I'll give it some thought and come back.

>   Federico
> 
-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list