Free weak map storage during background finalization for JS WeakMap objects
Categories
(Core :: JavaScript: GC, enhancement, P2)
Tracking
()
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file)
Found while working on bug 1952626.
Currently we clear and compact dead weak maps during weakmap sweeping, which frees the map storage. This happens with the mutator paused. Instead, where the weakmap is owned by a JSObject we can rely on the finalizer to delete the weakmap, which happens during background finalization with the mutator running.
Unfortunately this makes the test case in bug 1952626 about 10% slower, likely due to lock contention when allocating/freeing memory. For real world use cases this is probably an improvement though.
In future we may be able to make weakmaps use the buffer allocator for storage which would make this a win in all cases.
| Assignee | ||
Comment 1•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 2•9 months ago
|
||
This change will be incorporated in bug 1993212.
Comment 3•9 months ago
|
||
Bug 1993212 is closed now. Should this be duped over?
| Assignee | ||
Comment 4•9 months ago
|
||
Yes, there's nothing more to do here.
Description
•