Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
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
Test name
Executions per second
Array.find
20636126.0 Ops/sec
Object by key
281038464.0 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];