Clearing mark bitmaps can take a long time
Categories
(Core :: JavaScript: GC, enhancement, P3)
Tracking
()
Performance Impact | low |
Tracking | Status | |
---|---|---|
firefox66 | --- | fix-optional |
People
(Reporter: jonco, Unassigned)
References
(Depends on 1 open bug)
Details
(Keywords: perf:responsiveness)
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Reporter | ||
Comment 4•6 years ago
|
||
Reporter | ||
Comment 5•6 years ago
|
||
Reporter | ||
Comment 6•6 years ago
|
||
Reporter | ||
Updated•6 years ago
|
Comment 7•6 years ago
|
||
(In reply to Jon Coppeard (:jonco) from comment #5)
(In reply to Jon Coppeard (:jonco) from comment #4)
Paul had a better idea, which was to clear the mark bits lazily by having a
flag in the arena header to indicate that all cells should be treated as
unmarked. At the start of the GC we set the flag for all arenas and we only
clear the mark state when we need to mark a cell in an arena that has the
flag set. We can do this immediately with the current mark bit layout.
I've been thinking more about this.
I propose having two flags in each arena, One for "Everything is clear" and one for "Everything is marked" aka "This arena was allocated during collection". This second one will remove the cost of premarking (but not fixing the mark bits after sweeping). So there are 3 states we need to represent.
- Everything is unmarked
- Everything is marked
- Check individual mark bits.
We can do this separately also. Except there's currently one spare bit in the arena header, not two! Whichever we do 2nd (probably premarking) will involve changing the usable size of an arena.
Or we can use a single bit to defer to other data:
- Check the first cell's mark bit, that's the state of all the other mark bits.
- Check individual mark bits.
(if we really care about saving this space).
I chatted with Jon and I'll take this bug soon.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 8•4 years ago
|
||
I've tried a several different approaches, but haven't found any that give clear benefits. Abandoning this for now.
Reporter | ||
Comment 9•4 years ago
|
||
We parallelised this in bug 1677765.
Updated•3 years ago
|
Description
•