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•5 months ago
|
Comment 1•5 months 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•5 months ago
|
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Comment 2•5 months 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•5 months 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•5 months 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
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ab95bea5cab2 Part 1: Use more sepecific types in InnerViewTable r=jandem https://hg.mozilla.org/integration/autoland/rev/009227ccd93a Part 2: Partition inner view vector based on whether the view is in the nursery r=jandem
Comment 6•5 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ab95bea5cab2
https://hg.mozilla.org/mozilla-central/rev/009227ccd93a
Reporter | ||
Comment 7•5 months ago
|
||
This now takes 3.5 seconds, which is a pretty drastic improvement!
https://share.firefox.dev/3vs9gFG
Description
•