On vertical writing, GlyphPage::fill() uses CoreText instead of CG to map characters into glyphs. The CoreText path is obviously complex and slow. When I sampled with natural Japanese text rendering, I saw it is almost 2.5 times slower than CG path (around 100 samples vs around 270 samples.) We can improve the performance by using CG path on ideograph-only page even in vertical writing mode, as we know ideographs don't have a vertical variant glyph.
Created attachment 76295 [details] Propose patch. With this change, the count of CoreText path execution reduced to 1/7 in a test with natural Japanese text. Also the sample count becomes almost as same level as a case that forces to only use CG path.
Ideally we'd write a benchmark for this. WebCore/benchmarks would be a place to put such a thing. I'm not sure the easiest way to test drawing speed.
Comment on attachment 76295 [details] Propose patch. r=me
Comment on attachment 76295 [details] Propose patch. r-, actually. This is correct but I’d rather you didn’t add an anonymous boolean parameter to isCJKIdeograph(). Instead, please rename it to isCJKIdeographOrSymbol(), and factor out the isCJKIdeograph() part (and update call sites).
Created attachment 76469 [details] New proposed patch.
Thanks!
The commit-queue encountered the following flaky tests while processing attachment 76469 [details]: animations/suspend-resume-animation-events.html bug 51002 (author: cmarrin@apple.com) fast/workers/storage/use-same-database-in-page-and-workers.html bug 51003 (author: dumi@chromium.org) The commit-queue is continuing to process your patch.
The commit-queue encountered the following flaky tests while processing attachment 76469 [details]: http/tests/misc/uncacheable-script-repeated.html bug 51009 (author: koivisto@iki.fi) animations/suspend-resume-animation.html bug 51010 (author: cmarrin@apple.com) The commit-queue is continuing to process your patch.
The commit-queue encountered the following flaky tests while processing attachment 76469 [details]: inspector/timeline-recalculate-styles.html bug 51014 (authors: pfeldman@chromium.org and yurys@chromium.org) The commit-queue is continuing to process your patch.
Comment on attachment 76469 [details] New proposed patch. Clearing flags on attachment: 76469 Committed r74005: <http://trac.webkit.org/changeset/74005>
All reviewed patches have been landed. Closing bug.