Divide by integer versus multiply by fraction (v3)

Revision 3 of this benchmark created on


Description

Compares dividing by an integer versus an equivalent multiplication by a fraction.

Setup

const foo = Math.floor(Math.random() * 1000);

Test runner

Ready to run.

Testing in
TestOps/sec
Divide by integer
void foo / 2;
void foo / 4;
void foo / 5;
void foo / 8;
ready
Multiply by fraction
void foo * 0.5;
void foo * 0.25;
void foo * 0.2;
void foo * 0.125;
ready

Revisions

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