Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
array.find vs object by key
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_3_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/136.0.7103.56 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 136
Operating system:
iOS 18.3.2
Device Platform:
Mobile
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Object by key
281.0M/s
Array.find
20.6M/s
View exact numbers
Test name
Executions per second
✓
Object by key
281,038,464 Ops/sec
Array.find
20,636,126 Ops/sec
Script Preparation code:
var arrayExample = Array(40).fill().map((_, idx) => ({ id: idx })); var objExample = arrayExample.reduce((prev, curr) => prev[curr.id] = curr);
Tests:
Array.find
const found = arrayExample.find((item) => item.id === 39);
Object by key
const found = objExample[39];