Prefer to allocate from more full chunks first in the buffer allocator to reduce the total number of chunks
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file, 1 obsolete file)
To try to reduce the total number of chunks used we should prefer to allocate out of more full chunks when possible, with the idea being to let less full chunks empty out and be removed. This made a noticeable difference when we did it for the GC arena allocator.
Chunks don't have to be completely sorted for this to be useful. We can roughly sort chunks by amount of free space using a radix sort as part of sweeping.
| Assignee | ||
Comment 1•5 months ago
|
||
This does a radix sort to roughtly sort swept chunks into 8 buckets based on
free space.
We have to take care to clear the cached tail pointers if the main thread has
merged the chunk lists back while we were unlocked. We can detect this by the
destination list now being empty. This will also mess up to sort order. We will
tolerate this.
Comment 3•5 months ago
|
||
| bugherder | ||
| Assignee | ||
Comment 4•5 months ago
|
||
I originally filed this because I saw what seemed like an unnecessarily large number of chunks being used in my main Firefox instance. Since landing this bug however this has got worse if anything so I'm going to request this is backed out while I investigate.
| Assignee | ||
Comment 5•5 months ago
|
||
This reverts commit c65b22427960cc88b0111b80ee50b4ef289c553d.
Comment 7•5 months ago
|
||
Backout merged into central.
| Assignee | ||
Comment 8•5 months ago
|
||
No plans to land this for now. Bug 2045637 should reduce the total number of chunks used.
Updated•2 months ago
|
Description
•