loops

Benchmark created on


Setup

const array = new Array(100000);

Test runner

Ready to run.

Testing in
TestOps/sec
imperative
for(let i=0; i < array.length; i++) {
	let thing = Math.pow(i, 10);
	thing = Math.pow(i, 2);
	thing = Math.round(i);
	array[i] = thing;
}
ready
functional
for(let i=0; i < array.length; i++) {
	array[i] = Math.pow(i, 10);
}

for(let i=0; i < array.length; i++) {
	array[i] = Math.pow(array[i], 2);
}

for(let i=0; i < array.length; i++) {
	array[i] = Math.round(array[i]);
}
ready

Revisions

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