set vs. list: init + membership check

Benchmark created on


Setup

const xList = [1,2,3,4,5,6,7,9]
const xSet = new Set([1,2,3,4,5,6,7,9])

Test runner

Ready to run.

Testing in
TestOps/sec
list includes only
const result = xList.includes(6)
ready
set has only
const result = xSet.has(6)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.