freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] Speeding up afshaper.c


From: Behdad Esfahbod
Subject: [ft-devel] Speeding up afshaper.c
Date: Fri, 13 Oct 2017 12:29:30 +0200

Hi Werner,

I wrote a small test that measures initializing the autohinter.  Attached.  Would be nice if ftbench could do this as well.  Ie. not just load face, but load face and try loading one glyph.

With this, and with Roboto-Regular as well as Noto Naskh Arabic, initializing autohinter is 8 and 11 times slower if FreeType is compiled with HarfBuzz.  So I debugged this.  It came down to my inefficient hb_set_t implementation, but also that you are calling hb_set_create() a lot, 340 times!  I trimmed that down significantly by just moving the set creation closer to when it's needed.  That speeds it up by 25%ish.  Patch attached.

The rest of the fix is to actually fix my hb_set_t implementation to be efficient.  With this WIP patchset:

  https://github.com/behdad/harfbuzz/pull/23

I see things becoming 3 / 4 times faster, with a net result of harfbuzz-enabled autohinter setup be only 2 / 3 times slower than without.  That's reasonable I would say.

Anyway, please commit this.  And I'll go finish th hb_set_t patchset.

Cheers,
b

Attachment: main.c
Description: Text Data

Attachment: ft-hb-set.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]