Testcase generating N empty arrays is 2x slower and takes 8x more RAM compared to Chrome
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
People
(Reporter: mayankleoboy1, Unassigned, NeedInfo)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
Open testcase
Input 25000000 and click generate
Chrome: https://share.firefox.dev/41uCcsX (1.2s, 250MB)
Nightly: https://share.firefox.dev/41IZeh9 (2.5s, 2GB)
Artificial testcase. But maybe it highlights some hotspots? As usual, feel free to WONTFIX.
Comment 1•1 year ago
|
||
It looks like this is largely spending time in GC.
We have a bunch of minor GCs with 100% tenuring rate. Not sure why pretenuring isn't working here. Also, we don't seem to be increasing the nursery size?
Chrome's memory consumption numbers are surprising. If my math is correct, storing 25M arrays in 250MB implies that they're only using 10 bytes per array. Even with compressed pointers, that seems very space-efficient. I wonder if they're doing scalar replacement and noticing that the generated arrays don't escape.
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 2•1 year ago
|
||
empty strings in an array
500000000
Nightly: https://share.firefox.dev/3QNgtHS (14s, peak memory 3.5GB)
Chrome: https://share.firefox.dev/3DlaFSz (8s, 2GB peak memory)
| Reporter | ||
Comment 3•1 year ago
|
||
Empty strings
5000000000
Nightly: https://share.firefox.dev/4i31PIn (9.5s)
Chrome: Did not complete in 90seconds.
Updated•1 year ago
|
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 4•1 year ago
•
|
||
today i observed that sometimes, the testcase from comment 0 takes only half the time to run : https://share.firefox.dev/4jc5i7K
No idea what triggers this.. Iain, is it worth looking at the "intermittently better" profile?
Edit: after some testing looks like if you re-trigger the testcase before the GC/CC from the previous run has started (such that the page is continuing to use 2.5G RAM) then the subsequent run will take less time, maybe because some data-structure doesn't need to grow incrementally.
https://share.firefox.dev/41QctfX
| Reporter | ||
Updated•1 year ago
|
Description
•