Open Bug 1852105 Opened 1 year ago Updated 1 year ago

Look into reducing redundant work for nursery objects in nsPurpleBuffer::VisitEntries

Categories

(Core :: Cycle Collector, task)

task

Tracking

()

People

(Reporter: mccr8, Unassigned)

References

Details

In bug 1843477, Olli is changing the cycle collector's purple buffer so that all CCed objects use it, so we'll likely end up spending more time dealing with those objects.

Currently, VisitEntries first moves all of the nursery objects into the regular purple buffer, then iterates over the regular purple buffer, calling the Visit method from the visitor as it goes. The visitor can remove the object from the purple buffer. The iteration also does some compaction of the purple buffer as it goes.

Especially in the case of the SnowWhiteKiller, it is possible that many of the objects in the nursery are going to removed anyways, so moving them into the regular purple buffer and then immediately removing them doesn't seem very efficient. Right now the visitors return false to indicate that iteration should be stopped. Maybe there could be some additional return values to indicate whether the current entry should be removed or not. Then instead of always moving things into the regular purple buffer, the iteration over the nursery could skip things that are being removed anyways.

We probably want to see what the promotion rate is like before adding this complexity.

You need to log in before you can comment on or make changes to this bug.