Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object key access vs array find 100 items yeh ok
Test speed of object access by key vs array find to find object
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 18
Operating system:
iOS 18.1
Device Platform:
Mobile
Date tested:
one year ago
Object access
156K/s
Array find
61K/s
View exact numbers
Test name
Executions per second
✓
Object access
155,812 Ops/sec
Array find
61,349 Ops/sec
Script Preparation code:
var items = Array.from(Array(100), (_,x) => ({key: x, value: x*10})); var objContainer = {}; var arrContainer = []; for (let i = 100; i >= 0; i--) { const index = Math.floor(Math.random() * 100); const item = items[index]; objContainer[item.key] = item; arrContainer.push(item) }
Tests:
Object access
items.forEach(item => objContainer[item.value])
Array find
items.forEach(item => arrContainer.find(containerItem => containerItem.value === item.value))