div vs mul

Benchmark created on


Setup

const length = 1000000;
const data = [...Array(length).keys()]

Test runner

Ready to run.

Testing in
TestOps/sec
Div
let sum = 0;
for (let i = 0; i < length; ++i)
	sum += i / 0.5
ready
Mul
let sum = 0;
for (let i = 0; i < length; ++i)
	sum += i *2
ready

Revisions

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