Pretenure long-lived plain objects and arrays based on their allocation site
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox91 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Attachments
(11 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
This aims to add an allocation site abstraction and use it to pretenure long lived objects.
| Assignee | ||
Comment 1•4 years ago
|
||
This stores a pointer to a new AllocSite sturcture before every nursery cell.
Previously this was used to store a pointer to the zone, and we now have to get
the zone pointer from the AllocSite when necessary.
Since every cell must have such a pointer and we don't want to track all
allocation sites, there is a catch-call site per zone for unknown sites.
There's a second catch-all site which is used for optimized code generated for
known allocation sites by later patches.
| Assignee | ||
Comment 2•4 years ago
|
||
This adds an optional AllocSite parameter to the APIs that we will use to
create objects/arrays when JIT code falls back to calling into the VM.
Depends on D115236
| Assignee | ||
Comment 3•4 years ago
|
||
This adds logic to process allocation sites used since the last nursery
collection and update their state based on number of allocations made and now
many of those that were tenured.
This also dumps information about allocation sites to stderr if
JS_GC_REPORT_PRETENURING is set.
Depends on D115238
| Assignee | ||
Comment 4•4 years ago
|
||
For baseline allocations we still want to track the allocations made and update
the AllocSite whereas for optimized code we want to ignore this entirely and
use the catch-all optimzed site for tracked allocation sites. To allow this,
the patch adds AllocSiteInput which can either be a register holding an
AllocSite pointer or an immediate indicating which catch-all allocation site to
use.
Depends on D115240
| Assignee | ||
Comment 5•4 years ago
|
||
This allocates AllocSite instances when stubs are created. There's a limit on
the number created per minor GC to prevent runaway growth of the site list that
must be traversed at the next minor GC.
The fallback by which JIT code calls into the VM has to be different for
baseline/optimzed code because we still track allocations in baseline code. (It
might be possible to use the same one and have the baseline fallback just use
the unknow site. I think this would violate some assertions but they could
perhaps be relaxed)
Depends on D115241
| Assignee | ||
Comment 6•4 years ago
|
||
Unfortunately we often end up optimizing code before a minor GC happens and we
realize that we should be pretenuring a site. This invalidates JIT code when we
decide to pretenure a site.
Depends on D115242
| Assignee | ||
Comment 7•4 years ago
|
||
Depends on D115493
| Assignee | ||
Comment 8•4 years ago
|
||
This allows us to detect 'young' tenured arenas which are arenas that have been created since the last major GC.
Depends on D115494
| Assignee | ||
Comment 9•4 years ago
|
||
This is a bunch of heuristics to detect when sites that were short-lived become
long-lived and vice versa.
For the former we check the promotion rate for the whole nursery and the tenure
count for the optimized site in each zone. For the latter we look at tenured
objects that die in their first GC.
When then happens we discard JIT code and reset the allocation sites using the
list in the JitScript. This happens in one of two ways: if we are already
discarding JIT code then we reset the allocation sites for any remaining JIT
scripts, or if not we check all scripts in the zone and discard scripts
individually. This is so we don't add another script iteration if we're already
doing this for discarding JIT code.
Depends on D115495
| Assignee | ||
Comment 10•4 years ago
|
||
Adds tests for pretenuring, not pretenuring and recovery in both directions,
for plain object and array creation.
Depends on D115496
| Assignee | ||
Comment 11•4 years ago
|
||
Depends on D115498
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/375dea224b27
https://hg.mozilla.org/mozilla-central/rev/c6b66ee2c5f1
https://hg.mozilla.org/mozilla-central/rev/4c02be7ed57c
https://hg.mozilla.org/mozilla-central/rev/e03161d49696
https://hg.mozilla.org/mozilla-central/rev/1eb11eaf4089
https://hg.mozilla.org/mozilla-central/rev/d5f2380c3962
https://hg.mozilla.org/mozilla-central/rev/9a01131eb966
https://hg.mozilla.org/mozilla-central/rev/13737f4e5ff9
https://hg.mozilla.org/mozilla-central/rev/48527c5dd40c
https://hg.mozilla.org/mozilla-central/rev/2413939a6c9f
https://hg.mozilla.org/mozilla-central/rev/f8bcefb8c732
Comment 14•4 years ago
|
||
== Change summary for alert #30277 (as of Wed, 02 Jun 2021 17:24:19 GMT) ==
Improvements:
| Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|---|
| 12% | octane-sm | linux64-shippable | 19,439.79 -> 21,785.50 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=30277
Updated•4 years ago
|
Description
•