Test for loops

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
classic
let data = [...Array(1000).keys()];
for (var i = 0; i<1000; i++) {
	data[i] = 1000 - i;
}
ready
with function
let data = [...Array(1000).keys()];
data.forEach((d,i)=> {data[i] = 1000 - i;})
ready
classic complex
let data = [...Array(1000).keys()];
for (var i = 0; i<1000; i++) {
	data[i] = Math.floor(Math.random() * 1000);
}
ready
whith complex function

let data = [...Array(1000).keys()];
data.forEach((d,i)=> {data[i] = Math.floor(Math.random() * 1000);})
ready

Revisions

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