Reduce the size of ArenaLists by using a smaller linked list implementation
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox134 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(3 files)
Currently ArenaLists contains two linked lists per AllocKind (one for the arenas currently being allocated from and one for those being processed by the GC). The current list implementation uses two words per list, so that's currently four words per AllocKind. Work on bug 1911537 will add a bunch more more AllocKinds so I'd like to reduce the space that these take up.
Currently ArenaLists takes 1576 bytes on 64 bit Linux, of which 1120 bytes is used for these lists. Using a linked list implementation that only uses one word per list reduces that to 1016 bytes.
| Assignee | ||
Comment 1•1 year ago
|
||
Not related to the main changes here but this code is touched in a later patch
so it makes sense to simplify it first.
| Assignee | ||
Comment 2•1 year ago
|
||
The idea is to implement ArenaList with SinglyLinkedList, which only uses a
single word of storage.
This adds a couple of new methods that we'll need on the list representation.
removeRange is kinda awkward but is needed for compacting where we will have to
remove a section of the list.
iterFrom is used for incremental sweeping.
| Assignee | ||
Comment 3•1 year ago
|
||
This replaces ArenaList (two words) with SinglyLinkedList (one word). This
removes the arena cursor, a pointer that indicates where in the list we take
arenas from to use for allocation.
Instead this rearranges the list so that that this point is now the start of
the list. Since it is also a circular linked list it is just as efficient since to
take an element from the front of the list and move it to the back just
requires updating what we think the first element is.
Hopefully this makes the implementation of arena lists simpler by implementing
them in terms of more standard list primitives. It does make the compacting
code a little more complex since that now needs to remove a segment from the
middle of the list rather than being able to remove everthing up to the end of
the list.
It also means that list iteration needs to use the iterator provided to avoid
an infinite loop. That is mostly a simple change except in one or two places.
Updated•1 year ago
|
https://hg.mozilla.org/mozilla-central/rev/a80feb43f965
https://hg.mozilla.org/mozilla-central/rev/3f4228000112
https://hg.mozilla.org/mozilla-central/rev/07438f1f283c
https://hg.mozilla.org/mozilla-central/rev/248e8e68096f
Description
•