Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Usporedba 2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Find person in map
4264766.0 Ops/sec
Find person in array
399684.0 Ops/sec
Script Preparation code:
window.bigMap = {}; window.bigArray = Array.from({length: 1000}).map((_, index) => { const id = "person-id-" + index; const person = { id: id, name: `John Doe ${id}`, age: 18 + Math.floor(Math.random() * 70) }; bigMap[id] = person; return person })
Tests:
Find person in map
const id = "person-id-" + Math.floor(Math.random() * 1000); const person = window.bigMap[id];
Find person in array
const id = "person-id-" + Math.floor(Math.random() * 1000); const person = window.bigArray.find(p => p.id === id);