Closed Bug 1742591 Opened 4 years ago Closed 4 years ago

Keep pinned atoms in a list to reduce marking time

Categories

(Core :: JavaScript: GC, task, P1)

task

Tracking

()

RESOLVED FIXED
96 Branch
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: nobody → jcoppeard
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P1

About part 2, didn't we try this before and then revert it later because it caused TSan issues?

Flags: needinfo?(jcoppeard)

(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.

Flags: needinfo?(jcoppeard)
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/53696d13da41 Part 1: Add pinned atoms to a list and trace that instead of iterating the atoms table r=jandem https://hg.mozilla.org/integration/autoland/rev/144c0baf9eb2 Part 2: Move atom pinned flag to string flags instead of storing it in the atom table entry r=jandem https://hg.mozilla.org/integration/autoland/rev/0daeadd3c56c Part 3: Replace AtomStateEntry with a WeakHeapPtrAtom r=jandem
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Regressions: 1743423
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: