Open Bug 1926808 Opened 11 months ago Updated 11 months ago

Opening source view for https://html.spec.whatwg.org/ causes 100% CPU load all spend in Reflow

Categories

(Core :: Layout: Block and Inline, defect)

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:

  1. Open a new tab/window and load https://html.spec.whatwg.org/
  2. 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?

Flags: needinfo?(emilio)
Blocks: power-usage
Keywords: power
See Also: → 1918267

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?

Flags: needinfo?(emilio) → needinfo?(jfkthame)
Component: Layout → Layout: Block and Inline
Depends on: 1926820
Depends on: 1926824

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.

Flags: needinfo?(jfkthame)
See Also: → 1925916
Blocks: FastReflows

Profile: https://share.firefox.dev/3NDcwnl ( I quit after 11.5 minutes)

Keywords: perf

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.

Severity: -- → S3
See Also: → 1466704
Depends on: 1927114
You need to log in before you can comment on or make changes to this bug.