Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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:
4 months ago
Benchmark engine:
Benchmark.js
array
5K/s
object
3K/s
View exact numbers
Test name
Executions per second
✓
array
5,403 Ops/sec
object
3,125 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');