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/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15
Browser:
Safari 18
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
1
140381.3 Ops/sec
2
134890.8 Ops/sec
3
97625.5 Ops/sec
4
121160.4 Ops/sec
5
133901.5 Ops/sec
6
135202.6 Ops/sec
7
134513.4 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))