high cpu usage and rendering stops for long period
Categories
(Core :: Disability Access APIs, defect, P1)
Tracking
()
People
(Reporter: alice0775, Assigned: morgan)
References
(Blocks 1 open bug)
Details
(Keywords: nightly-community, perf)
Attachments
(5 files)
Steps to reproduce.
- open attached html
- when tab spinner stops spinning, scroll down
Actual results:
high cpu usage and rendering stops for long period.
Profiler : https://share.firefox.dev/3CWZrhY
Screenshot: see attached
Setting accessibility.force_disabled to 1 fixes the issue.
Reporter | ||
Comment 1•3 years ago
|
||
Reporter | ||
Comment 2•3 years ago
|
||
Reporter | ||
Updated•3 years ago
|
Comment 3•3 years ago
|
||
This looks serious enough that it should be looked at soon.
Comment 4•2 years ago
|
||
I ran into a similar perf problem with a similar profile just now testing a huge Searchfox file on an older computer.
The interesting thing about this profile is that we spend a lot of time in CoalesceEvents, called by PushEvent, called by PruneOrInsertSubtree. The only thing I can see in PruneOrInsertSubtree that fires an event is the firing of EVENT_TABLE_STYLING_CHANGED.
My suspicion is that a full reflow occurs, so PruneOrInsertSubtree ends up running on every node, including every table, row and cell. On a large table, that means we'll have a huge number of EVENT_TABLE_STYLING_CHANGED events, and since we're firing them on individual cells, they can't be de-duplicated. That results in a huge event queue which CoalesceEvents repeatedly walks through.
As I understand it, this event is only used on Mac and then only to invalidate the layout guess for the entire table. Eventually, we won't even need that, since this will be handled by CTW.
Morgan, is there any reason we can't fire this on the table instead of the rows/cells? We already have to walk to the table anyway for CTW and that's far cheaper than building a huge queue of events which we repeatedly try (and fail) to coalesce.
Assignee | ||
Comment 5•2 years ago
|
||
(In reply to James Teh [:Jamie] from comment #4)
I ran into a similar perf problem with a similar profile just now testing a huge Searchfox file on an older computer.
The interesting thing about this profile is that we spend a lot of time in CoalesceEvents, called by PushEvent, called by PruneOrInsertSubtree. The only thing I can see in PruneOrInsertSubtree that fires an event is the firing of EVENT_TABLE_STYLING_CHANGED.
My suspicion is that a full reflow occurs, so PruneOrInsertSubtree ends up running on every node, including every table, row and cell. On a large table, that means we'll have a huge number of EVENT_TABLE_STYLING_CHANGED events, and since we're firing them on individual cells, they can't be de-duplicated. That results in a huge event queue which CoalesceEvents repeatedly walks through.
As I understand it, this event is only used on Mac and then only to invalidate the layout guess for the entire table. Eventually, we won't even need that, since this will be handled by CTW.
Morgan, is there any reason we can't fire this on the table instead of the rows/cells? We already have to walk to the table anyway for CTW and that's far cheaper than building a huge queue of events which we repeatedly try (and fail) to coalesce.
I don't think there's any reason we can't fire them on the table.
We use the event on non-table moz accessible's right now, but only to invalidate their containing table.
I think removing that bit of code and instead relying on this one should be sufficient.
Assignee | ||
Comment 6•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/79e305189497
https://hg.mozilla.org/mozilla-central/rev/6e82360f0f0c
Updated•2 years ago
|
Comment 12•2 years ago
|
||
I can not reproduce the issue on Win10 x64 using Firefox build 93.0a1(20210816215309) and the html file from description.
Can you please confirm issue is not reproducing on latest Beta 106.0b8(https://archive.mozilla.org/pub/firefox/candidates/106.0b8-candidates/) or Nightly 107.0a1(https://archive.mozilla.org/pub/firefox/nightly/2022/10/2022-10-05-21-51-13-mozilla-central/)? Thank you.
Reporter | ||
Comment 13•2 years ago
|
||
I manage to reproduce this issue in Nightly 93.0a1(20210816215309) Windows10 w/ ATOK insight.
And I verified fix in Nightly107.0a1(20221005215113) and Firefox106.0.0b8.
Description
•