Keep pinned atoms in a list to reduce marking time
Categories
(Core :: JavaScript: GC, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox96 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(3 external files)
Currently we iterate the atoms table to tracing pinned atoms at the start of GC (if we're collectin atoms). This can take a reasonable length of time, and can be seen in GC profiles. This is because the atoms table is frequently large, e.g. > 50000 atoms with normal browser usage. Iterating the atoms table like this is inefficient since often only around 10% of atoms are pinned.
We could keep pinned atoms in a separate list to speed up marking. This would allow us to simplify a bunch of code since we current store the pinned flag in the low bits of the atom pointer in the atoms table. Also, we could then disentangle pinning from atomization.
It's possible that this would be a memory regression, but it would be a nice simplification so I'd like to try it.
| Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
| Assignee | ||
Comment 2•4 years ago
|
||
Depends on D131938
| Assignee | ||
Comment 3•4 years ago
|
||
Depends on D131939
Updated•4 years ago
|
Comment 4•4 years ago
|
||
About part 2, didn't we try this before and then revert it later because it caused TSan issues?
| Assignee | ||
Comment 5•4 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #4)
About part 2, didn't we try this before and then revert it later because it caused TSan issues?
Yes, we did! This happened in bug 1547565. It was backed out for slowing down GC marking - something patch 1 avoids.
| Assignee | ||
Comment 6•4 years ago
|
||
This change might increase memory usage, although an AWSY run shows no important changes:
Comment 8•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/53696d13da41
https://hg.mozilla.org/mozilla-central/rev/144c0baf9eb2
https://hg.mozilla.org/mozilla-central/rev/0daeadd3c56c
Description
•