Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
2d array construction
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
1
57417.0 Ops/sec
2
151886.1 Ops/sec
3
149743.1 Ops/sec
4
72439.6 Ops/sec
5
150552.7 Ops/sec
6
151392.6 Ops/sec
7
151486.1 Ops/sec
Script Preparation code:
rows = 500; cols = 500;
Tests:
1
Array.from({ length: rows }, () => Array().fill(0, 0, cols))
2
Array(rows).fill(null).map(() => Array().fill(0, 0, cols))
3
[...Array(rows)].map(() => Array().fill(0, 0, cols))
4
Array.from(new Array(rows), () => Array().fill(0, 0, cols))
5
Array(rows).fill(0).map(() => Array().fill(0, 0, cols))
6
Array(rows).fill(void 0).map(() => Array().fill(0, 0, cols))
7
Array(rows).fill(undefined).map(() => Array().fill(0, 0, cols))