Fri 19 Sep 2014 06:44:11 PM UTC, comment #1:
Hi Behdad, Here is the response I sent to freetype-devel on 9/5.
It is true that disabling hints for the Adobe CFF engine does not give a significant performance advantage as it did with the old engine. The new engine is optimized for rendering with hints. It makes a single pass over the outline. The old engine made two passes, with the second (optional) pass applying hints. However, the new engine is somewhat faster than the old one when rendering with hints.
I do not have easy access to the fontconfig test that you mention. I tried to simulate it with ftbench as follows.
I enabled CFF_CONFIG_OPTION_OLD_ENGINE and built a 64-bit Release target for Windows with Visual Studio. I used ftbench to call FT_Load_Glyph with various flags:
FT_LOAD_DEFAULT (0)
FT_LOAD_NO_SCALE (1)
FT_LOAD_NO_HINTING (2)
I used the font SourceHanSans-Regular.otf (one of the fonts you mention; the other weights have similar results). So, for example, the first value, below, is from this command:
ftbench -H -f 0 -b a SourceHanSans-Regular.otf
Flag New CFF Old CFF
- 49us 54us
1 39us 19us
2 48us 19us
Note that the new CFF engine has two ways to modify outlines in a size-dependent way. The first is by hinting (grid-fitting) and the second is by stem darkening. FT_LOAD_NO_HINTING does not turn off stem darkening. There are situations where you want to darken stems at small sizes for unhinted glyphs. FT_LOAD_NO_SCALE DOES turn off both hinting and darkening. Or, you can set the driver property "no-stem-darkening". Stem darkening does incur a performance cost and in the ftbench test above, stem darkening has an effect. Patching ftbench to turn it off yields times of 40us for flags 0 and 2. But, hinting has almost no effect on the performance of the new engine.
So, depending on what calls fontconfig is making, I can understand a factor of 2 or 2.5 in comparing unhinted outlines. I don't understand why there would be a factor of 5, as you observed. And I don't see an easy fix.
Thanks.
-Dave
|