Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Set.has vs Array.includes for small number of items Bv2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
array_1
111677096.0 Ops/sec
set_1
103426296.0 Ops/sec
array_8
94897240.0 Ops/sec
set_8
90601432.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const array_1 = new Array(1).map((_, i) => self.crypto.randomUUID() ); const set_1 = new Set(array_1); const item_1 = array_1[0]; const array_2 = new Array(1, 2).map((_, i) => self.crypto.randomUUID() ); const set_2 = new Set(array_2); const item_2 = array_2[1]; const array_4 = new Array(1, 2, 3, 4).map((_, i) => self.crypto.randomUUID() ); const set_4 = new Set(array_4); const item_4 = array_2[3]; const array_8 = new Array(1, 2, 3, 4, 5, 6, 7, 8).map((_, i) => self.crypto.randomUUID() ); const set_8 = new Set(array_8); const item_8 = array_2[7];
Tests:
array_1
array_1.includes(item_1)
set_1
set_1.has(item_1)
array_8
array_8.includes(item_8)
set_8
set_8.has(item_8)