A demo spends ~2minutes completely around GC (GCMinor?)
Categories
(Core :: JavaScript Engine, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: mayankleoboy1, Assigned: jonco)
References
(Blocks 1 open bug, )
Details
Attachments
(2 files)
Go to https://davidsaltacc.github.io/pages/generative-art/fractals-v1
QUICKLY slide the first slider "size" all the way to the right
AR: https://share.firefox.dev/48K1p4J (1m40s spend completely around GC)
ER: maybe something to improve here?
Edit: Profile from Chrome is https://share.firefox.dev/4aN3G0w
Reporter | ||
Updated•1 year ago
|
Comment 1•1 year ago
|
||
From reading the profile, it seems that the code is creating many TypedArrays using TypedArray.prototype.subarray
. TypedArray.prototype.subarray
creates a new TypedArray, but shares the ArrayBuffer with the source TypedArray. This leads to registering the ArrayBuffer in InnerViewTable. And the profile seems to spend most of the time cleaning up these InnerViewTable
entries.
Reporter | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
This page creates millions of long lived views for a single ArrayBuffer. Currently these are all swept on minor GC to clean up nursery allocated ones, but this ends up being very inefficient when most of them are not in the nursery.
Assignee | ||
Comment 3•1 year ago
|
||
To make it clearer what's going on this replaces JSObject with
ArrayBufferObject and ArrayBufferViewObject where possible and does some other
tidy ups.
Assignee | ||
Comment 4•1 year ago
|
||
This patch changes the inner view vector to store all nursery views at the end,
and records the index of the first nursery view. This allows us to sweep only
the nursery views after minor GC.
For the page in question this reduces the proportion of time spent in GC from
100% to around 35%.
Depends on D197775
Comment 6•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ab95bea5cab2
https://hg.mozilla.org/mozilla-central/rev/009227ccd93a
Reporter | ||
Comment 7•1 year ago
|
||
This now takes 3.5 seconds, which is a pretty drastic improvement!
https://share.firefox.dev/3vs9gFG
Description
•