Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
includes-mapping-set
(version: 1)
Comparing performance of:
includes vs mappiing vs set
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ const arr = [] for(let i =0;i<300000;i++){ arr.push(i) }
Tests:
includes
for(let i=0;i<10000;i++){ arr.includes(300000) }
mappiing
const map = {} const arrLen = arr.length for(let i=0;i<arrLen;i++){ map[arr[i]] = true } for(let i=0;i<10000;i++){ map[300000] }
set
const set = new Set(arr) for(let i=0;i<10000;i++){ set.has(300000) }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
includes
mappiing
set
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser/OS:
Chrome 136 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
includes
3.1 Ops/sec
mappiing
436.5 Ops/sec
set
84.2 Ops/sec
Related benchmarks:
Test array concat
Nullish vs If
Hihihihi
Pushing
For vs Foreach manu
test-string-1
Object vs Map MYTEST2137
Array length to string 1
Test intArrya
Comments
Confirm delete:
Do you really want to delete benchmark?