Using the stock Sun 1.6 compiler and JRE/JIT, is it a good idea to use Duff's Device to unroll a loop? Or does it end up as code obfuscation with no performance benefit.
I have a loop here and I want to make it run faster. I am passing in a large array. I recently heard of Duff's Device can it be applied to this for loop? any ideas?
for (i = 0; i < dim; i++) {
for (j = 0; j < dim; j++) {
dst[RIDX(dim-1-j, i, dim)] = src[RIDX(i, j, dim)];
}
}