Open Bug 1951984 Opened 1 year ago Updated 1 year ago

Testcase generating N empty arrays is 2x slower and takes 8x more RAM compared to Chrome

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

People

(Reporter: mayankleoboy1, Unassigned, NeedInfo)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

Attached file Empty Arrays.html —

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.

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.

Component: JavaScript Engine → JavaScript: GC

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)

Attached file Empty strings.HTML —

Empty strings
5000000000
Nightly: https://share.firefox.dev/4i31PIn (9.5s)
Chrome: Did not complete in 90seconds.

Severity: -- → N/A
Priority: -- → P3
No longer blocks: 1943230
See Also: → 1943230

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

Flags: needinfo?(iireland)
Flags: needinfo?(iireland) → needinfo?(jcoppeard)
Blocks: 1980560
See Also: 1943230 →
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: