Closed Bug 1904810 Opened 2 years ago Closed 2 years ago

3.27 - 2.14% speedometer3 TodoMVC-Svelte-Complex-DOM/DeletingAllItems/total / speedometer3 TodoMVC-WebComponents/DeletingAllItems/total + 3 more (OSX) regression on Mon June 17 2024

Categories

(Core :: DOM: Bindings (WebIDL), defect, P2)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox127 --- unaffected
firefox128 --- unaffected
firefox129 --- fixed
firefox130 --- fixed

People

(Reporter: fbilt, Assigned: jonco)

References

(Regression)

Details

(Keywords: perf, perf-alert, regression)

Attachments

(1 obsolete file)

Perfherder has detected a browsertime performance regression from push f342fbf7ef65a2801087802a93e7a1ab9f81859c. As author of one of the patches included in that push, we need your help to address this regression.

Regressions:

Ratio Test Platform Options Absolute values (old vs new) Performance Profiles
3% speedometer3 TodoMVC-Svelte-Complex-DOM/DeletingAllItems/total macosx1400-64-shippable-qr fission webrender 2.46 -> 2.54 Before/After
3% speedometer3 TodoMVC-Svelte-Complex-DOM/DeletingAllItems/Async macosx1400-64-shippable-qr fission webrender 1.83 -> 1.88 Before/After
3% speedometer3 TodoMVC-Svelte-Complex-DOM/DeletingAllItems/Async macosx1400-64-shippable-qr fission webrender 1.83 -> 1.89 Before/After
3% speedometer3 TodoMVC-WebComponents/DeletingAllItems/Sync macosx1400-64-shippable-qr fission webrender 2.81 -> 2.88 Before/After
2% speedometer3 TodoMVC-WebComponents/DeletingAllItems/total macosx1400-64-shippable-qr fission webrender 3.15 -> 3.22 Before/After

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests. Please follow our guide to handling regression bugs and let us know your plans within 3 business days, or the patch(es) may be backed out in accordance with our regression policy.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.

You can run these tests on try with ./mach try perf --alert 902

For more information on performance sheriffing please see our FAQ.

Flags: needinfo?(jcoppeard)

Set release status flags based on info from the regressing bug 1903034

I'll try and write a patch to address this.

The patch in bug 1903034 added a call to DropJSObjects in CallbackObject::Reset. This does two things:

  • removes the JS holder from the holder map data structure
  • calls its trace hook to clear any references to JS GC things

As a first attempt at a possible mitigation we could skip calling the trace hook in cases where we know the references have already been cleared, such as when called from CallbackObject::Reset. I wrote a patch to do this and the results look promising but since the effect is small it's hard to say for sure that this will fix things.

Another possibility is to change the way the holders map works. Currently we need to do a hash table lookup on add and remove to find the location of the holder entry in one of the holder lists. If we could store a pointer to the entry in the holder object itself we could do without the hash table and associated lookup costs. I'm not sure how to do this cleanly though.

Flags: needinfo?(jcoppeard)

Not that I should be recommending we make this data structure even more complex, but I wonder if there's some mileage we could get out of a "nursery" for the JS holders. It feels like that in this test there must be a lot of short lived objects, so could we take advantage of that to deal with JS holders more efficiently? You'd empty out the nursery into the regular table when doing a GC or CC. I'm not sure what the would look like. At the simplest, it could be the same data structure as the regular holder maps, but if it only had short lived objects maybe it would be smaller and thus more cache efficient?

This adds a new version of DropJSObjects, DropJSObjectsWithoutClear (better
naming suggestions appreciated). This removes the holder from the holder map
without callling the trace hook to clear references to JS GC things. In debug
builds it asserts that such references have already been cleared.

I don't love adding this extra API but tests show this may help mitigate the
preformance regression. What do you think?

Assignee: nobody → jcoppeard
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P2

I also tried not clearing the JS refs in CallbackObject::Reset and relying on DropJSOjbects to do this as suggested by Andrew in the review comments. The results were pretty equivocal and didn't suggest that this would help.

Keywords: leave-open
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/316531363a05 Add an API to drop a JS holder that has already been cleared r=mccr8

Hi :jonco, Are we currently waiting for the new perf results resulting from your commit so that we know what to do next?

Flags: needinfo?(jcoppeard)

(In reply to Hsin-Yi Tsai (she/her) (REO Fx 129) [:hsinyi] from comment #9)
Yes, that was my plan. However looking at the graphs doesn't show any real difference that I can see.

Flags: needinfo?(jcoppeard)

Set release status flags based on info from the regressing bug 1903034

(In reply to Jon Coppeard (:jonco) from comment #10)

(In reply to Hsin-Yi Tsai (she/her) (REO Fx 129) [:hsinyi] from comment #9)
Yes, that was my plan. However looking at the graphs doesn't show any real difference that I can see.

If that's the case, should we consider to back the regressor out? Or are there other places we can try?

Flags: needinfo?(jcoppeard)
Flags: needinfo?(continuation)

I'll leave it to Jon, though it does not look like there are any clear Speedometer3 improvements from the original patch, so that seems to weaken the argument for leaving it in.

Flags: needinfo?(continuation)

Although not the priority right now it would be a shame to lose the improvements in bug 1902347.

I'll get the patch in this bug backed out since it didn't help. I'm working on another approach that looks like it should help, and if that doesn't work we can back out the original change.

Flags: needinfo?(jcoppeard)
Backout by tszentpeteri@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/392dd57be837 Backed out changeset 316531363a05 for not fixing the regressions. CLOSED TREE

Backed out of beta for Fx129
hg.mozilla.org/releases/mozilla-beta/rev/364e65b07adb6007932fbf0997ba3f954b8e8eee

I tried a couple of other things but they didn't help so I'll request backout of the original patch.

Setting Fx130 as fixed since the regressor Bug 1903034 was backed out of central
See https://bugzilla.mozilla.org/show_bug.cgi?id=1903034#c6

This will also later be backed out of beta to address the regression in Fx129

Setting Fx129 as fixed since the regressor Bug 1903034 was backed out of central
See https://bugzilla.mozilla.org/show_bug.cgi?id=1903034#c8

There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:jonco, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(jcoppeard)
Flags: needinfo?(continuation)
Flags: needinfo?(continuation)

Fixed by backout of bug 1903034.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(jcoppeard)
Keywords: leave-open
Resolution: --- → FIXED
Attachment #9410808 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: