Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array find vs Map get I
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/140.0.0.0 Safari/537.36
Browser:
Chrome 140
Operating system:
Windows
Device Platform:
Desktop
Date tested:
9 months ago
map get
119K/s
array find
2K/s
View exact numbers
Test name
Executions per second
✓
map get
118,966 Ops/sec
array find
2,378 Ops/sec
Script Preparation code:
const arr = Array.from({ length: 1000 }, () => Math.floor(Math.random() * 100) + 1 );
Tests:
array find
for (var i = 0; i < 1000; i++) { arr.find(v => v === i) }
map get
const m = new Map() arr.forEach(v => { m.set(v, v) }) for (var i = 0; i < 1000; i++) { m.get(i) }