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