Testing bucles and Duff

Benchmark created by EtnasSoft on


Test runner

Ready to run.

Testing in
TestOps/sec
Traditional
var opValue = 0;
for (var x = 1; x < 50000;
(opValue++) && x++);
ready
Plain
var opValue = 0;
var m = 50000;
while (--m) {
 opValue++;
}
ready
Duff
var opValue = 0,
    iterations = 50000,
    i = iterations % 8;
if (i > 0) {
 do {
  opValue++; // Operation we want to performe goes here...
 } while (--i);
}

i = parseInt(iterations / 8);
do {
 opValue++; // Operation we want to performe goes here...
 opValue++; // and here..
 opValue++; // and here..
 opValue++; // and here..
 opValue++; // and here..
 opValue++; // and here..
 opValue++; // and here..
 opValue++; // and here..
} while (--i);
ready

Revisions

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

  • Revision 1: published by EtnasSoft on