Regular Loop 1 | var testVal = 0;
var n = iterations;
while (n--) {
testVal++;
}
| ready |
Regular Loop 2 |
var v = 0, i = iterations;
while(i>0){
v++;
i--;
};
| ready |
Duff's Device |
var testVal = 0;
var n = iterations / 8;
var caseTest = iterations % 8;
do {
switch (caseTest) {
case 0:
testVal++;
case 7:
testVal++;
case 6:
testVal++;
case 5:
testVal++;
case 4:
testVal++;
case 3:
testVal++;
case 2:
testVal++;
case 1:
testVal++;
}
caseTest = 0;
}
while (--n > 0);
| ready |
Fast Duff's Device #01 |
var testVal = 0;
var n = iterations % 8;
while (n--) {
testVal++;
}
n = parseInt(iterations / 8);
while (n--) {
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
}
| ready |
Fast Duff's Device #02 |
var testVal = 0;
var n = iterations % 8;
while (n--) {
testVal++;
}
n = Math.floor(iterations / 8);
while (n--) {
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
}
| ready |
Fast Duff's Device #03 |
var testVal = 0;
var n = iterations % 8;
while (n--) {
testVal++;
}
n = (iterations / 8) ^ 0;
while (n--) {
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
}
| ready |
Fast Duff's Device #04 |
var testVal = 0;
var n = iterations % 8;
while (n--) {
testVal++;
}
n = (iterations * 0.125) ^ 0;
while (n--) {
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
testVal++;
}
| ready |
JS.duffsDevice.008 |
var v = 0, i = iterations;
while(i>7){
v++;v++;v++;v++;v++;v++;v++;v++;
i-=8;
};
switch(i){case 7:v++;case 6:v++;case 5:v++;case 4:v++;case 3:v++;case 2:v++;case 1:v++;};
| ready |
JS.duffsDevice.016 |
var v = 0, i = iterations;
while(i>15){
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
i-=16;
};
while(i>7){
v++;v++;v++;v++;v++;v++;v++;v++;
i-=8;
};
switch(i){case 7:v++;case 6:v++;case 5:v++;case 4:v++;case 3:v++;case 2:v++;case 1:v++;};
| ready |
JS.duffsDevice.032 |
var v = 0, i = iterations;
while(i>31){
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
i-=32;
};
while(i>7){
v++;v++;v++;v++;v++;v++;v++;v++;
i-=8;
};
switch(i){case 7:v++;case 6:v++;case 5:v++;case 4:v++;case 3:v++;case 2:v++;case 1:v++;};
| ready |
JS.duffsDevice.064 |
var v = 0, i = iterations;
while(i>63){
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
i-=64;
};
while(i>7){
v++;v++;v++;v++;v++;v++;v++;v++;
i-=8;
};
switch(i){case 7:v++;case 6:v++;case 5:v++;case 4:v++;case 3:v++;case 2:v++;case 1:v++;};
| ready |
JS.duffsDevice.128 |
var v = 0, i = iterations;
while(i>127){
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
v++;v++;v++;v++;v++;v++;v++;v++;
i-=128;
};
while(i>7){
v++;v++;v++;v++;v++;v++;v++;v++;
i-=8;
};
switch(i){case 7:v++;case 6:v++;case 5:v++;case 4:v++;case 3:v++;case 2:v++;case 1:v++;};
| ready |