New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 634312 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Slow first layout on text-heavy site on Windows

Project Member Reported by tzik@chromium.org, Aug 4 2016

Issue description

The first layout of http://b.hatena.ne.jp/ takes 447ms on ToT Chrome (r409720) on my Windows 10 machine. That is twice as slow as Linux case.
It calls IDWriteFactory::CreateGlyphRunAnalysis() 2236 times and that takes 334ms in total, which is 75% of the layout time.

The callstack toward IDWriteFactory::CreateGlyphRunAnalysis() is:
IDWriteFactory::CreateGlyphRunAnalysis
SkScalerContext_DW::getBoundingBox
SkScalerContext_DW::generateMetrics
SkScalerContext::getMetrics
SkGlyphCache::allocateNewGlyph
SkGlyphCache::lookupByPackedGlyphID
SkGlyphCache::getGlyphIDMetrics
sk_getMetrics_glyph_next

Note that the performance of IDWF::CGRA() depends on the font it uses. In this case, it uses default font, Yu Gothic, but if I switch it to MSGothic, IDWF::CGRA() gets 3 times as fast as Yu Gothic case.

TODO: Check the cache layers

Any idea to improve the performance? Is there any lightweight alternative of it?
 

Comment 1 by drott@chromium.org, Aug 4 2016

Great findings, tzik@, thanks for digging into this. Any idea on the hit ratio of Skia's glyph cache? How many times do we go down to DWrite to retrieve the metrics (2236) vs. finding the metrics from the SkGlyphCache?

Can we canonicalize the test case by recording the page using web-page-replay and playing it back from that? 

kulshin@, any ideas for a more lightweight call to retrieve glyph metrics that could be used in Skia?

Comment 2 by drott@chromium.org, Aug 4 2016

The other question I had - how do your Linux and Windows machines compare in terms of hardware - "twice as slow as on Linux" would probably need to be calibrated by the differences in hardware here?

Comment 3 by tzik@chromium.org, Aug 5 2016

> Any idea on the hit ratio of Skia's glyph cache? How many times do we go down to DWrite to retrieve the metrics (2236) vs. finding the metrics from the SkGlyphCache?

On this case, the hit ratio of SkGlyphCache is 85%. SkGlyphCache::lookupByPackedGlyphID was called 12161 times, and within that, 1716 cases went down to DW through allocateNewGlyph.


> Can we canonicalize the test case by recording the page using web-page-replay and playing it back from that? 

Yeah, we should make it. The value changes day by day in wild :-/.

> The other question I had - how do your Linux and Windows machines compare in terms of hardware - "twice as slow as on Linux" would probably need to be calibrated by the differences in hardware here?

Well, I just compare the raw value of layout time of Linux and Windows, naively assuming the performance of Z620 and Z440 don't differ so much, at least for single core performance and memory access time.
I agree we need calibration them to understand the situation precisely.

Project Member

Comment 4 by sheriffbot@chromium.org, Aug 7 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 5 by e...@chromium.org, Aug 9 2017

Status: Available (was: Untriaged)
Project Member

Comment 6 by sheriffbot@chromium.org, Aug 9

Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: WontFix (was: Untriaged)
This is a known problem and is tackled by LayoutNG, progress of which is tracked in issue 591099.

Sign in to add a comment