Closed Bug 1609956 Opened 4 years ago Closed 4 years ago

Discourage atoms zone collection during page load

Categories

(Core :: JavaScript: GC, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

As suggested by Ted, we can experiment with discouraging atoms zone GC during page load since this can block off-thread parsing. This is to help with performance on Fenix, but has general applicability (until stencil lands and makes this moot).

smaug, what's a good way to find out if we are 'in pageload'?

I tried looking at gNumberOfDocumentsLoading in nsDocShell.cpp (there is some code that does that already to change event dispatch priorites) but ran into bug 1610272.

Flags: needinfo?(bugs)

This adds a JS API to set a performance hint which tells the engine whether a global is in pageload or not. The engine keeps a count so it knows whether any global for that runtime is in pageload, and adjusts GC thresholds appropriately. Currently this strongly discourages atoms GC by doubleing the trigger threshold. This does not disallow it entirely, but with this change it should almost never happen.

This is meant to be a temporary fix. When the stencil project lands we will not have this annoying dependency between parsing and atoms zone GC and can remove this change.

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4748b86a39fa
Discourage atoms zone collection during page load r=sfink,smaug
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Regressions: 1612130

== Change summary for alert #24822 (as of Thu, 30 Jan 2020 10:42:53 GMT) ==

Improvements:

3% JS windows10-64-shippable-qr opt 112,158,338.22 -> 109,061,870.81
3% JS windows10-64-qr opt 110,915,859.25 -> 107,851,540.06
2% JS windows10-64-shippable-qr opt 111,834,030.40 -> 109,049,216.87
2% Explicit Memory windows10-64-qr opt 367,451,004.69 -> 359,920,481.66

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=24822

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: