Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.includes vs Set.has vas Map.has 123
(version: 1)
Comparing performance of:
Array includes vs Set has vs Map has
Created:
one year ago
by:
Registered User
Go to the latest result
Script Preparation code:
var a = [1]; var b = new Set([1]); var c = new Map([[1, 1]]);
Tests:
Array includes
return a.includes(1);
Set has
return b.has(1);
Map has
return c.has(1);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array includes
Set has
Map has
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
4 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:149.0) Gecko/20100101 Firefox/149.0
Browser/OS:
Firefox 149 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Map has
2948.1M/s
Set has
2940.0M/s
Array includes
118.0M/s
View exact numbers
Test name
Executions per second
✓
Map has
2,948,113,152 Ops/sec
Set has
2,940,019,968 Ops/sec
Array includes
117,991,992 Ops/sec
Related benchmarks
Array.includes vs Set.has vas Map.has
has vs includes
Array.includes vs Set.has vas Map.has big
Array.includes vs Set.has vas Map.has 2
Array.includes vs Set.has vas Map.has with large data set
Comments
Confirm delete:
Do you really want to delete benchmark?