Closed Bug 1953749 Opened 1 year ago Closed 9 months ago

Free weak map storage during background finalization for JS WeakMap objects

Categories

(Core :: JavaScript: GC, enhancement, P2)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1993212

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.

Severity: -- → N/A
Priority: -- → P2

This change will be incorporated in bug 1993212.

Bug 1993212 is closed now. Should this be duped over?

Yes, there's nothing more to do here.

Status: NEW → RESOLVED
Closed: 9 months ago
Duplicate of bug: 1993212
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: