array set

Benchmark created on


Setup

const values = Array.from({length: 10}).map((x, i) => `item-${i}`)

const set= new Set(values)

Test runner

Ready to run.

Testing in
TestOps/sec
Set
const output = set.has(`item-2`)
ready
Array
const output = values.includes(`item-2`)
ready

Revisions

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