Add a per-zone gray root callback
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
People
(Reporter: jonco, Assigned: jonco)
Details
Attachments
(1 obsolete file)
Currently there is a single callback to allow the embedding to supply gray roots.
Since the browser now knows which zone some of its roots are in, we can have a separate callback to get the roots for a particular zone. This will allow us to fetch the gray roots in parallel by zone where there is more than one zone being collected.
| Assignee | ||
Comment 1•5 years ago
|
||
This allows the embedding to register a per-zone gray root callback, as well the existing one. This will enable getting the gray roots in parallel for multiple zones. From the comments in the patch:
The embedding can supply callbacks to tell the GC about roots that are gray
(that is, that are reachable from the embedding but may not be reachable from
any JS roots).
When the GC needs to trace the gray roots in a set of zones, it first calls
any the tracer registered with JS_SetGrayGCRootsTracer and then calls any
tracer registered with JS_SetPerZoneGrayGCRootsTracer once for each zone.
Either, both or neither of these callbacks may be supplied.
Comment 2•5 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:jonco, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
Comment 3•4 years ago
|
||
Why did you decide that incremental grey root scanning is more promising than parallel, out of curiosity?
| Assignee | ||
Comment 4•4 years ago
|
||
We can only parallelise by zone, and within a single GC slice. It wouldn't fix the problem of having to complete it in one slice and it wouldn't help at all if there is only one zone being collected.
Doing this incrementally means we can split it across multiple slices. This is likely to reduce impact on users (i.e. jank due to blowing the slice budget) even though main thread GC time will remain the same as it is currently.
Comment 5•4 years ago
•
|
||
That makes sense. I'd assume the bulk of gray roots are in the big hashtable, and presumably you could do something like freeze the main hash table and then have two separate sets for objects added and removed while the iteration is in progress, or something like that.
| Assignee | ||
Comment 6•4 years ago
|
||
Closing this as we're not planning to take this approach.
Description
•