HasSpaceInLigaturesOrKerning is performing redundant work |
||
Issue descriptionThe font analysis performed in HasSpaceInLigaturesOrKerning is a function on FontPlatformData and is performed a very large number of times during incoming shaping calls into CachingWordShaper and word cache segmentation. The actual font table analysis is performed on hb_face and is size independent. The result of this analysis should be stored in HarfBuzzFace and computed only once per unique SkTypeface / font blob. This is the likely trigger / playing into the regressions we observed in issue 782220 , when we changed the hb_set implementation.
,
Dec 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b809ea4814644cce7c9219ff55f2f18b18d56351 commit b809ea4814644cce7c9219ff55f2f18b18d56351 Author: Dominik Röttsches <drott@chromium.org> Date: Thu Dec 07 10:31:39 2017 Move HasSpaceInLigaturesOrKerning to HarfBuzzFace Previously a set if bechmark stories triggered the expensive glyph collection in GSUB and GPOS way too many times. This was found while investigating and hb_set performance issue 781794 . browse:news:cnn triggered the call and GSUB/GPOS scanning method 1395 times, and was reduced to two. browse:news:hackernews 33 times reduced to 4, browse:social:twitter 58 times reduced to 4, browse:social:twitter_infinite_scroll 38 times reduced to 4 as well. We only need to do this work once per font face, independent of size - whereas previously it was once per Font object, which, depending on layout of the page, triggers much more frequently. Test: FontPlatformDataTest Bug: 791475 Change-Id: I15757abab2037677d5ea4c640ac26ab99da4649c Reviewed-on: https://chromium-review.googlesource.com/809106 Commit-Queue: Dominik Röttsches <drott@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#522394} [modify] https://crrev.com/b809ea4814644cce7c9219ff55f2f18b18d56351/third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp [modify] https://crrev.com/b809ea4814644cce7c9219ff55f2f18b18d56351/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp [modify] https://crrev.com/b809ea4814644cce7c9219ff55f2f18b18d56351/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h [modify] https://crrev.com/b809ea4814644cce7c9219ff55f2f18b18d56351/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFontCache.h
,
Dec 7 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by drott@chromium.org
, Dec 4 2017