HarfBuzzShaper::shapeResult() takes a major part of layout time (~90%) on CJK site on Windows. In its callchain, shapeRange() and extractShapeResults() take large part of time (~40% and ~60% resp.).
Both of them call SkGlyphCache::getGlyphIDMetrics() in its callchain, and it takes large part of time for each.
SkGC::gGIDM() is called for the same glyph by sR() and eSR(), but due to a text size adjustment in SkTextBaseIter::SkTextBaseIter(), SkGlyphCache instances are not shared by sR() and eSR(), that hurts the layout performance.
IMO, we should either:
- Stop adjusting the text size in SkTextBaseIter, (or add a mode to avoid the adjustment)
- Or, use the adjusted text size in HarfBuzzShaper::shapeRange callchain.
Comment 1 by kinuko@chromium.org
, May 11 2016Labels: Performance