Opening source view for https://html.spec.whatwg.org/ causes 100% CPU load all spend in Reflow
Categories
(Core :: Layout: Block and Inline, defect)
Tracking
()
People
(Reporter: whimboo, Unassigned)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Keywords: perf, power)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0 ID:20241015214157
Steps to reproduce:
- Open a new tab/window and load https://html.spec.whatwg.org/
- Press Cmd+U (Mac) to open the source view
You will notice that nothing is actually happening and all other code as run via the main thread (like opening DevTools, or hitting any keyboard shortcut) is blocked. Checking the web content processes I can see that 100% of the time is spend in Reflow for the view source window.
Here is a Gecko profile: https://share.firefox.dev/4eTpeu5
Emilio, do you have an idea what's going on here?
Reporter | ||
Updated•11 months ago
|
Comment 1•11 months ago
|
||
Here's a profile with symbols: https://share.firefox.dev/4e2asjF
We seem to be hitting some quadratic behavior during bidi resolution, around here.
I'm not the most familiar with this code to know how easy to improve this would be... Maybe we can also do something on the view-source page to make it cheaper... There are some pretty massive lines and view-source multiplies the number of elements, so...
Jonathan, any idea?
Updated•11 months ago
|
Comment 2•11 months ago
|
||
Yeah, I think there are a few situations where we can end up with quadratic (or worse?) behavior when we're maintaining long chains of continuations (for the actual textframe, and potentially for inline wrapper frames as well). Bug 1925916 is another recent example that's probably somewhat related.
I'd expect something like bug 1926824 to help significantly with the view-source example. Putting huge amounts of (potentially-bidi) text into a single <pre> is a bad case.
Updated•11 months ago
|
Comment 3•11 months ago
|
||
Profile: https://share.firefox.dev/3NDcwnl ( I quit after 11.5 minutes)
Comment 4•11 months ago
•
|
||
Triaging as S3 given this is a pretty extreme case. For comparison: in Chrome, view-source:https://html.spec.whatwg.org/
simply triggers a content-process crash after a few seconds, on my machine at least.
Description
•