Set vs. Array storing

Benchmark created on


Setup

const mySet = new Set()
const myArr = []

Test runner

Ready to run.

Testing in
TestOps/sec
Set
for (let i = 0; i < 10000; i++) {
	mySet.add(i)
}
ready
Arrary
for (let i = 0; i < 10000; i++) {
	myArr.push(i)
}
ready

Revisions

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