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