Optimize branches in TenuringTracer::traverse
Categories
(Core :: JavaScript: GC, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox125 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(3 files)
This function is very hot during nursery collections because it's used to trace object slots/elements. It has branches to check for object/string/bigint values, but in practice about 50% of the values we see there aren't GC things and it would be nice to reduce the number of branches in this case.
We could check isGCThing()
first to 'discard' about 48% of all values because they aren't gc things. After that we can check if the cell is tenured, this gets rid of another ~25% of values. That leaves about 27% of nursery-allocated values.
A Speedometer 3 comparison of just this change shows a number of medium/high confidence 1-2% improvements on a number of sub tests.
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
On Speedometer 3, about 48% of the values aren't GC things so check for
this first. Of the remaining values, about 47% are tenured so check for that
next.
This reduces the number of branches we have to take and improves some Speedometer 3
sub tests by a few percent.
Assignee | ||
Comment 2•1 year ago
|
||
Checking is-native upfront lets us avoid checking for the 3 non-native object types
for native objects not special-cased there. Similarly this also reduces the number of
branches for non-native objects.
Assignee | ||
Comment 3•1 year ago
|
||
isForwarded()
is true in about 45% of cases.
Updated•1 year ago
|
Comment 5•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1193e9ba23df
https://hg.mozilla.org/mozilla-central/rev/2645007f875c
https://hg.mozilla.org/mozilla-central/rev/d75a5d616386
Description
•