Reduce memory use of SortedArenaList
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox124 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 1 open bug)
Details
(Keywords: perf-alert)
Attachments
(8 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
This takes 4072 bytes and is only used during incremental foreground sweeping. This is nearly 40% of the size of GCRuntime.
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
| Assignee | ||
Comment 2•1 year ago
|
||
Most uses of this are from the GC when there will not be any foreground
finalized arenas to iterate.
| Assignee | ||
Comment 3•1 year ago
|
||
Currently we link the foreground finalized arenas in the sorted arena list into
a single list when we yield to the mutator during foreground finalization.
Iteration is only required for the debugger and memory reporting APIs so it
makes sense to skip this until it's actually needed. This also centralises the
state of which zone/kind we are finalizing in the GCRuntime rather than storing
it in each zone.
| Assignee | ||
Comment 4•1 year ago
|
||
We have to copy out the tail pointer for each list segment in the sorted arena
list when converting it to a single list so we can restore it later.
This reduces size of SortedArenaList (used in GCRuntime) from 4072 to 2040 bytes.
| Assignee | ||
Comment 5•1 year ago
|
||
I don't know why this had a separate constant for the same value, but we can
move MinCellSize into HeapAPI.h and use it here.
| Assignee | ||
Comment 6•1 year ago
|
||
This implements putting arenas into N bins using N/2 lists by inserting either
at the front of the back of a list as necessary.
This further reduces the size of SortedArenaList to 1032 bytes.
| Assignee | ||
Comment 7•1 year ago
|
||
| Assignee | ||
Comment 8•1 year ago
|
||
Comment 10•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/5d252ab19fe3
https://hg.mozilla.org/mozilla-central/rev/859d7297fe2f
https://hg.mozilla.org/mozilla-central/rev/3e7f6daeeaab
https://hg.mozilla.org/mozilla-central/rev/b191fc95b97f
https://hg.mozilla.org/mozilla-central/rev/8163c091644a
https://hg.mozilla.org/mozilla-central/rev/3a5a8d217d70
https://hg.mozilla.org/mozilla-central/rev/6138042213fd
https://hg.mozilla.org/mozilla-central/rev/7d03e4900bb3
Comment 11•1 year ago
|
||
(In reply to Pulsebot from comment #9)
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5d252ab19fe3
Part 1: Add a template for a circular singly linked list r=sfink
https://hg.mozilla.org/integration/autoland/rev/859d7297fe2f
Part 2: Split off an arena iter that is only used by the GC r=sfink
https://hg.mozilla.org/integration/autoland/rev/3e7f6daeeaab
Part 3: Lazily link foreground finalized arenas only when needed by
iteration r=sfink
https://hg.mozilla.org/integration/autoland/rev/b191fc95b97f
Part 4: Repalace use of SortedArenaListSegment with SinglyLinkedList in
SortedArrayList r=sfink
https://hg.mozilla.org/integration/autoland/rev/8163c091644a
Part 5: Use MinCellSize constant in SortedArenaList r=sfink
https://hg.mozilla.org/integration/autoland/rev/3a5a8d217d70
Part 5.5: Pass alloc kind into SortedArenaLists to simplify debug checks
r=sfink
https://hg.mozilla.org/integration/autoland/rev/6138042213fd
Part 6: Make use of the fact that lists have two ends to halve the number of
lists in SortedArenaList r=sfink
https://hg.mozilla.org/integration/autoland/rev/7d03e4900bb3
Part 7: Rename SortedArenaList segments to buckets r=sfink
== Change summary for alert #41531 (as of Wed, 21 Feb 2024 10:50:43 GMT) ==
Improvements:
| Ratio | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|
| 0.27% | Base Content JS | linux1804-64-shippable-qr | fission | 1,505,428.67 -> 1,501,410.67 |
| 0.27% | Base Content JS | macosx1015-64-shippable-qr | fission | 1,506,344.00 -> 1,502,210.67 |
| 0.27% | Base Content JS | macosx1015-64-shippable-qr | fission | 1,506,344.00 -> 1,502,248.00 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=41531
Description
•