Testcase writing back-and-forth between canvas and webgl seems to do tons of "nursery malloc buffers" with 96% tenuring rate
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
People
(Reporter: mayankleoboy1, Unassigned)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
|
1.53 KB,
text/html
|
Details |
Open testcase
Click Run (DO NOT select the checkbox)
Firefox: https://share.firefox.dev/46U1WmV (60s)
Chrome: 50s
We are not much slower than chrome, and this is primarily a gfx thing. But is there anything that seems worthwhile to investigate from JS perspective?
Updated•1 year ago
|
Comment 1•1 year ago
|
||
After looking at it a bit, the interesting thing here is that we're getting a whole series of NURSERY_MALLOC_BUFFERS minor GCs, each of which tenures 96%. These are coming because it is allocating tons of typed arrays in the nursery with malloc data, and those allocations are registered with the nursery, and it's the allocations for the registration hashtable that trigger the minor GCs.
Which raises a question: should the nursery's own accounting be triggering nursery collections? At least in this case, it seems like it really ought to be triggering minor GCs based on TOO_MUCH_MALLOC (or maybe OUT_OF_NURSERY). But it's arguable, and nothing is really broken here.
I don't know if reducing these minor GCs would speed things up, but the test case is artificial and stresses memory enough that it doesn't seem worth fixing just for this scenario. It's at least something to watch out for, though: lots of NURSERY_MALLOC_BUFFERS minor GCs, and the memory is being allocated under HashSet<...>::putNew. (And these allocations will almost certainly be swamped by the mallocs that they are tracking, so you need native allocation tracking to see them.)
needinfo? jonco just as an FYI; I mentioned this at our meeting earlier, but tracked it down farther. (I erroneously claimed it was string buffers; it is not.)
Updated•1 year ago
|
| Reporter | ||
Comment 2•1 year ago
•
|
||
This seems to be "fixed" in the latest Nightly - that is, the 96% Tenuring rate and "nursery malloc buffers" are all gone.
Profile: https://share.firefox.dev/3HGQH73 (50s)
Bisection points to https://phabricator.services.mozilla.com/D261113 (Bug 1976558)
Comment 3•10 months ago
|
||
I'll mark this as fixed given comment 2. It looks like the performance is the same as Chrome now and looking at the profile little of the time is related to GC.
Description
•