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 1-2% improvements on a number of sub tests. https://treeherder.mozilla.org/perfherder/comparesubtest?originalProject=try&newProject=try&newRevision=0eae5ffd806a5fa22d393fb49684fee30673fb2c&originalSignature=4586009&newSignature=4586009&framework=13&application=firefox&originalRevision=827fe39e928d1a7b6cf118f335d8c46d85a81a22&page=1
Bug 1881019 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
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. https://treeherder.mozilla.org/perfherder/comparesubtest?originalProject=try&newProject=try&newRevision=0eae5ffd806a5fa22d393fb49684fee30673fb2c&originalSignature=4586009&newSignature=4586009&framework=13&application=firefox&originalRevision=827fe39e928d1a7b6cf118f335d8c46d85a81a22&page=1