Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
access object vs array
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/148.0.0.0 Safari/537.36
Browser:
Chrome 148
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one month ago
Test name
Executions per second
object
3125.2 Ops/sec
array
5402.5 Ops/sec
Tests:
object
let obj = {}; let n = 10000; while (n--) { obj['id-'+i]=n; } const res = obj['id-1000'];
array
let arr = []; let n = 10000; while (n--) { arr.push({name:'id-'+i,value:n}); } const res = arr.find(x=>x.name=='id-1000');