Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Map.get versus Array.find for 100 elements
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array to Map and find
16589978.0 Ops/sec
Array.find
11113318.0 Ops/sec
Script Preparation code:
data = [...Array(100)].map((_, id) => ({ id, data: Math.random() })) map = new Map(data.map(v => [v.id, v]))
Tests:
Array to Map and find
const res = map.get(50)
Array.find
const res = data.find(({ id }) => id === 50)