loops (v2)

Revision 2 of this 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(thing, 2);
	thing = Math.round(thing);
	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.