Discourage atoms zone collection during page load
Categories
(Core :: JavaScript: GC, enhancement, P1)
Tracking
()
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).
Assignee | ||
Comment 1•4 years ago
|
||
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.
Comment 2•4 years ago
|
||
Something like https://searchfox.org/mozilla-central/rev/803a42f24c8714631ed81cb824ea1c1a803cb7b8/dom/base/PostMessageEvent.cpp#259-261
would be even Fission compatible.
Assignee | ||
Comment 3•4 years ago
|
||
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
Comment 5•4 years ago
|
||
bugherder |
Comment 6•4 years ago
|
||
== 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
Description
•