set vs array

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Set: adding elements [huge dataset]
const set = new Set();
Array.from({length: 10000}).forEach((i) => {
	set.add(i);
});
ready
Array: adding elemnts [huge dataset]
const array = [];
Array.from({length: 10000}).forEach((i) => {
	array.push(i);
});
ready

Revisions

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