Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
has vs includes vs convert
(version: 1)
Comparing performance of:
includes vs has vs convert to set then has
Created:
2 months ago
by:
Guest
Go to the latest result
Script Preparation code:
var arr = Array.from(100).fill().map((_, index) => index); var set = new Set(arr);
Tests:
includes
arr.includes(5);
has
set.has(5);
convert to set then has
new Set(arr).has(5)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
includes
has
convert to set then has
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15
Browser/OS:
Safari 26 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
has
480.6M/s
includes
108.1M/s
convert to set then has
68.9M/s
View exact numbers
Test name
Executions per second
✓
has
480,587,904 Ops/sec
includes
108,144,616 Ops/sec
convert to set then has
68,930,264 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?