Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
hole array test
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
with hole
12.8 Ops/sec
without hole
12.8 Ops/sec
Script Preparation code:
var array1 = new Array(3); // you get a sparse array with 3 holes array1[0] = 'a'; array1[1] = 'b'; array1[2] = 'c'; var array2 = ['a', 'b', 'c']; var temp1 = []; var temp2 = [];
Tests:
with hole
for (let j = 0; j < 1e5; ++j) { for (let i = 0; i < array1.length; ++i) { temp1.push(array1[i]); } }
without hole
for (let j = 0; j < 1e5; ++j) { for (let i = 0; i < array2.length; ++i) { temp2.push(array2[i]); } }