do while non-zero

Benchmark created on


Description

I assume that with mothern js engines, there is no need for n>0 anymore and n is enough. Let's test this!

Test runner

Ready to run.

Testing in
TestOps/sec
n
let n = 1e3, x = 0;
do x = n + n, --n;
while (n);
ready
n > 0
let n = 1e3, x = 0;
do x = n + n, --n;
while (n > 0);
ready
0 < n
let n = 1e3, x = 0;
do x = n + n, --n;
while (0 < n);
ready
n != 0
let n = 1e3, x = 0;
do x = n + n, --n;
while (n != 0);
ready
n !== 0
let n = 1e3, x = 0;
do x = n + n, --n;
while (n !== 0);
ready
!!n
let n = 1e3, x = 0;
do x = n + n, --n;
while (!!n);
ready

Revisions

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