mult vs division index (v4)

Revision 4 of this benchmark created on


Setup

const numbers = [];
for (let i=1; i <= 100000; i++) {
	numbers.push({
		A: Math.random(),
		B: Math.random(),
		C: Math.random(),
		D: Math.random()
	})
}

Test runner

Ready to run.

Testing in
TestOps/sec
division
numbers.forEach(n => ((n.A/n.B)/(n.C/n.D)));
ready
mult optimized
numbers.forEach(n => ((n.A*n.D)/(n.C*n.B)));
ready
division2
numbers.forEach(n => ((n.A/n.B)/(n.C/n.D)));
ready
mult optimized 2
numbers.forEach(n => ((n.A*n.D)/(n.C*n.B)));
ready

Revisions

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