Incremental GC can block off-thread parsing
Categories
(Core :: JavaScript: GC, defect, P1)
Tracking
()
Performance Impact | high |
Tracking | Status | |
---|---|---|
firefox69 | --- | wontfix |
firefox70 | --- | wontfix |
firefox71 | --- | fix-optional |
People
(Reporter: tcampbell, Assigned: mgaudet)
References
(Blocks 1 open bug)
Details
(Keywords: perf:pageload)
(Cloning from Bug 1543776 into JS component)
The following microbenchmark stalls offthread parsing while an incremental gc is occuring. This has shown up in page load profiles.
var doGC = true;
// Generate a long script to parse
fragment = " + a";
for (var i = 0; i < 19; ++i) {
fragment = fragment + fragment;
}
offThreadScript = "var a = 2; var x = " + fragment + ";";
// Start incremental GC
if (doGC) {
startgc(1);
}
// Start the off-thread
var jid = offThreadCompileScript(offThreadScript);
// Spin main-thread
for (var i = 0; i < 1000000; ++i) {
with({}){} // Prevent IonMonkey
}
// Finish incremental GC
if (doGC) {
finishgc();
}
// Wait for parse result
runOffThreadScript(jid);
Reporter | ||
Comment 1•6 years ago
|
||
Perf profiles imported into GeckoProfiler (thanks :jesup!)
Without_GC: https://perfht.ml/2UPvwFk
With_GC: https://perfht.ml/2UPwhya
Updated•6 years ago
|
Comment 2•6 years ago
|
||
FWIW, I'm testing https://hg.mozilla.org/try/rev/bc3d5ce21c69c5a270d488d1dbe8c37ae62337b6 and how it affects to tp6 and tp6m
Reporter | ||
Updated•6 years ago
|
Comment 3•5 years ago
|
||
Matthew, what is the progress around this issue?
Assignee | ||
Comment 4•5 years ago
|
||
In progress, but still a couple months out. I've added the meta bug I have been working under to the blockers list for this one, so the dependency tree is more clear.
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
Using the microbenchmark Ted wrote in comment #1, modified to dump timing, I will note that I do still see delay introduced by the finishGC of ~500ms.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 6•4 years ago
|
||
This Bug 1658631 landed this underlying issue is solved so I will close this bug. We haven't turned on by default in browser yet, but are working towards that soon in Bug 1662102.
tcampbell@ironman:~/projects/gecko.dev$ ./mach run stencil-bench.js
Wall-time: 1224ms
tcampbell@ironman:~/projects/gecko.dev$ ./mach run --no-off-thread-parse-global stencil-bench.js
Wall-time: 960ms
Updated•3 years ago
|
Description
•