Open Bug 1991980 Opened 2 months ago Updated 1 month ago

Delay tracing WeakMaps until everything else is marked

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

ASSIGNED

People

(Reporter: sfink, Assigned: sfink)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Split off from bug 1935829. They're mostly independent.

WeakMap marking overhead mostly comes from the situation where a WeakMap is discovered to be reachable, but contains many live keys that have not yet been discovered to be reachable. This overhead can be reduced, sometimes dramatically, by delaying tracing the WeakMaps until everything else has been marked. At that time, the maps can be scanned and all live keys' entries traced through, and only the dead or not yet reached keys will need to be entered into the ephemeron table. This saves the time adding keys to the table that weren't reached when the map was first reached, but will be reached by the end of marking (as in, without needing to go through a WeakMap).

Note that dead keys will still be entered into the table and swept at the end, because it is unknown at map tracing time whether they are truly dead or just haven't been reached yet.

Assignee: nobody → sphink
Status: NEW → ASSIGNED
Severity: -- → N/A
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: