Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
map.has vs. array.includes - large array - random Access
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0
Browser:
Firefox 137
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
lookup
2182.8M/s
includes
22K/s
View exact numbers
Test name
Executions per second
✓
lookup
2,182,811,136 Ops/sec
includes
21,757 Ops/sec
Script Preparation code:
var a = []; var b = new Map() for(let i = 0; i < 100000; i++){ a.push(i); b.set(i, Math.random()); }
Tests:
includes
return a.includes(Math.floor(Math.random()*100000))
lookup
return b.has(Math.floor(Math.random()*100000))