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
2
152K/s
7
151K/s
6
151K/s
5
151K/s
3
150K/s
4
72K/s
1
57K/s
View exact numbers
Test name
Executions per second
✓
2
151,886 Ops/sec
7
151,486 Ops/sec
6
151,393 Ops/sec
5
150,553 Ops/sec
3
149,743 Ops/sec
4
72,440 Ops/sec
1
57,417 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))