[HarfBuzz] Amiri and OpenType performance

Khaled Hosny khaledhosny at eglug.org
Tue Apr 16 23:36:38 PDT 2013


On Tue, Apr 16, 2013 at 09:59:58PM -0400, Behdad Esfahbod wrote:
> Ok, I found a bug in the set digest initialization and fixed it.  Minor
> lookups (those affecting a few glyphs only) are much faster now.  Please
> re-measure.

It is much faster now indeed. With the new HarfBuzz and the new font,
things are now as twice as fast.

from last night:

time hb-shape amiri-0.105/amiri-regular.ttt --text-file=test-suite/ar.txt --num-iterations=1000 --shapers=ot &>/dev/null
real	0m40.262s
user	0m40.211s
sys	0m0.000s

Now:

time hb-shape amiri-regular.ttf --text-file=test-suite/ar.txt --num-iterations=1000 --shapers=ot &>/dev/null
real	0m18.865s
user	0m18.833s
sys	0m0.004s

time hb-shape amiri-regular.ttf --text-file=test-suite/ar.txt --num-iterations=1000 --shapers=old &>/dev/null
real	1m3.882s
user	1m3.800s
sys	0m0.004s

time hb-shape amiri-regular.ttf --text-file=test-suite/ar.txt --num-iterations=1000 --shapers=icu_le &>/dev/null
real	5m49.700s
user	5m49.266s
sys	0m0.004s

Is ICU LE really that slow!

Regards,
Khaled

> 
> b
> 
> On 13-04-16 05:11 PM, Khaled Hosny wrote:
> > On Tue, Apr 16, 2013 at 04:19:56PM -0400, Behdad Esfahbod wrote:
> >> On 13-04-15 06:21 PM, Khaled Hosny wrote:
> >>> On Mon, Apr 15, 2013 at 10:37:05PM +0200, Khaled Hosny wrote:
> >>>> On Mon, Apr 15, 2013 at 04:20:09PM -0400, Behdad Esfahbod wrote:
> >>>>> BTW, disabling 'kern' makes it more than twice faster!
> >>>>
> >>>> Aha. Looks like my support for subtending marks is totally inefficient,
> >>>> it amounts for half the processing time! I guess I know where to look
> >>>> now.
> >>>
> >>> Half of the kern overhead is from the duplication to support subtending
> >>> marks in both HarfBuzz and Uniscribe (I tried using ltra/rtla but that
> >>> doesn’t work). I’m still thinking of a more efficient way to do it.
> >>
> >> Can you elaborate a bit?  I like to better understand this, and hopefully we
> >> can also find a better way to do it.
> > 
> > The aya mark issue we discussed on the Persian computing list few months
> > ago; basically when script is Arabic, a string
> > 
> >   <aya><digit¹><digit²><digit³>
> > 
> > Will be matched in reverse order by HarfBuzz, unlike Uniscribe or even
> > HarfBuzz itself when using setting script to Latin, even though the
> > output will be left to right in all cases.
> > 
> > Anyway, I rewrote that code and it is now less complex and saves around
> > 25% overall (though now it is broken for ICU LE, but I can’t care less).
> > Dropping the duplications saves another 5%
> > 
> > http://www.khaledhosny.org/files/tmp/amiri-regular.ttf
> > 
> > Other than that I see no obvious way to decrease the number of lookups,
> > lumping a dozen or so of calt and kern lookups together made things
> > worse actually.
> > 
> > Regards,
> > Khaled
> > 
> 
> -- 
> behdad
> http://behdad.org/



More information about the HarfBuzz mailing list