Java: manually-unrolled loop is still faster than the original loop. Why?
Consider the following two snippets of code on an array of length 2: boolean isOK(int i) { for (int j = 0; j < filters.length; ++j) { if (!filters[j].isOK(i)) { return false; } } return true; } and boolean isOK(int i) { return filters[0].isOK(i) && filters[1].isOK(i); } I would assume that the performance of these … Read more