Map constructor

Benchmark created on


Setup

const arr = [];

for (let i; i < 1000000; i++) { arr.push([`index-${i}`,i]) }

let map = new Map(arr);

Test runner

Ready to run.

Testing in
TestOps/sec
From map
for (let i = 0; i < 1000; i++) {
	map = new Map(map);
}
ready
From arr
for (let i = 0; i < 1000; i++) {
	map = new Map(arr);
}
ready

Revisions

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