array.values.map vs array.map

Benchmark created on


Setup

var count = 10000*1000

Test runner

Ready to run.

Testing in
TestOps/sec
simple map
const array = []
for(let i = 0; i < count ; i++) {
	array[i] = i;
}

array.map((i) => i)
ready
values().map
const array = []
for(let i = 0; i < count ; i++) {
	array[i] = i;
}

array.values().map((i) => i)
ready
values().map + predefined array
const array = new Array(count);
for(let i = 0; i < count ; i++) {
	array[i] = i;
}

array.values().map((i) => i)
ready

Revisions

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