Page becomes unresponsive while loading an svg with a lot of nodes
Categories
(Core :: SVG, defect, P2)
Tracking
()
People
(Reporter: ksenia, Assigned: jfkthame)
References
(Regression, )
Details
(Keywords: perf:pageload, regression)
Attachments
(1 file)
This was initially reported in https://github.com/webcompat/web-bugs/issues/73237
STR:
- Visit https://github.com/tokio-rs/console if Firefox Nightly 90 (2021-05-25), scroll down to "extremely cool and amazing demo" title and observe the page
Actual:
Page becomes unresponsive, bottom half of the page is not loaded until the svg loads
Expected:
Page is responsive and contents are loaded
The reporter is experiencing the issue on Windows, but I also can reproduce it on Mac.
Performance profile: https://share.firefox.dev/33BjEtr
The link to the svg (the issue is not reproducible when there is only svg on the page): https://camo.githubusercontent.com/e6b2a4f6fe2d2503477539667ab0c80c1ba93e5c6c31fd2d2b735aef13d7d184/68747470733a2f2f61736369696e656d612e6f72672f612f3431323133392e737667
Reporter | ||
Comment 1•3 years ago
|
||
From mozregression:
2:45.43 INFO: Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=0d51fdccaa965d303b4a50e6ef245906642bc5f7&tochange=7ed193fb34e39d12d6a1dd9a88aab03e2fff786c
Reporter | ||
Comment 2•3 years ago
|
||
Hi Chris, looks like this is related to 1697865, would you be able to take a look?
Comment 3•3 years ago
|
||
I got a different range.
Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=69dff8dbabec5ab16420b65b236eac7e0e429ad6&tochange=5852b2a0d166247d9732827f087e1331e2b83846
Reporter | ||
Comment 4•3 years ago
|
||
Thanks Alice. I run mozregression on Windows and get the same window as you. Still getting the original window on Mac :/
It seems like 1696792 is likely related to this, rather than 1697865, so I'll change the component
Reporter | ||
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Set release status flags based on info from the regressing bug 1696792
Updated•3 years ago
|
Comment 6•3 years ago
|
||
Jonathan, can you look into this?
Assignee | ||
Comment 7•3 years ago
|
||
Oof. The svg image appears to wrap every individual character of the "console" display in a separate tspan, with explicit x-coordinate positioning. We used to run them together into a single textrun, but we no longer do that (because of issues such as bug 1696792), so this now becomes really expensive as we do the whole line-breaking, text-shaping dance involved in text-frame layout separately for each one of them. We should see if we can optimize that somehow.
Assignee | ||
Comment 8•3 years ago
|
||
Given that we know we'll be shaping each tspan independently, and won't be doing line-breaking, maybe we can have a simplified version of textrun creation for textframes that are part of SVG, and avoid some of the cost here.
Marking this as S3 as it's a fairly obscure use-case, I think, although the impact in this example is pretty bad.
Reporter | ||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Hey :jfkthame,
We are increasing the priority to P2 because this is a breaking change. Do you know how we can move forward with this?
Assignee | ||
Comment 11•3 years ago
|
||
The original page mentioned in comment 0 has changed so that it no longer exhibits this issue, but it can be reproduced easily with an example such as:
data:text/html,<img src="https://camo.githubusercontent.com/e6b2a4f6fe2d2503477539667ab0c80c1ba93e5c6c31fd2d2b735aef13d7d184/68747470733a2f2f61736369696e656d612e6f72672f612f3431323133392e737667">
which takes around 16s to reflow in Nightly on my MacBook.
Assignee | ||
Comment 12•3 years ago
|
||
As we don't support multi-line text in SVG, there's no point running the line-breaker and
collecting potential break positions for textframes that are part of an SVG text subtree.
Telling BuildTextRunsScanner to skip this makes it somewhat less expensive.
In my local build, this reduces the reflow time of the testcase from nearly 20s to about 4.5s.
Still much too long, but at least it's a step in the right direction.
Updated•3 years ago
|
Comment 13•3 years ago
|
||
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4a265cea0290 Skip running the line-breaker when scanning SVG text frames. r=emilio
Comment 14•3 years ago
|
||
bugherder |
Comment 15•3 years ago
|
||
Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
Updated•2 years ago
|
Description
•