New issue
Advanced search Search tips

Issue 606249 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 609117
Owner: ----
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 609117



Sign in to add a comment

nextBreakablePosition performance woes with long strings of text

Project Member Reported by pdr@chromium.org, Apr 25 2016

Issue description

Version: 51.0.2704.19/dev
OS: OSX

What steps will reproduce the problem?
(1) Visit https://codepen.io/samdbeckham/pen/OPXPNp
(2) Notice the page takes ages to load

The time is being spent down in nextBreakablePosition due to the long strings of text. Unhelpfully, the page forces several extra relayouts, but there's a real performance issue here. This happens on many pages but this is the most recent time I've seen it in the wild. Firefox is really quick to lay this out.

If you printf at the last line in nextBreakablePosition, it looks like there may be an easy optimization for long strings:
...
nextBreakablePosition pos: 1935, len: 50000, returning with 50000
nextBreakablePosition pos: 1986, len: 50000, returning with 50000
nextBreakablePosition pos: 2037, len: 50000, returning with 50000
nextBreakablePosition pos: 2088, len: 50000, returning with 50000
nextBreakablePosition pos: 2139, len: 50000, returning with 50000
nextBreakablePosition pos: 2190, len: 50000, returning with 50000
nextBreakablePosition pos: 2241, len: 50000, returning with 50000
nextBreakablePosition pos: 2292, len: 50000, returning with 50000
...
 

Comment 1 by e...@chromium.org, Apr 25 2016

This is one of the issues I hope to address with shaper driven line breaking.

Comment 2 by e...@chromium.org, Aug 26 2016

Blockedon: 609117

Comment 3 by e...@chromium.org, Aug 26 2016

Mergedinto: 609117
Status: Duplicate (was: Available)

Sign in to add a comment