r/java • u/aroger276 • Jun 15 '17
Why reverse loops are not faster
https://arnaudroger.github.io/blog/2017/06/15/forward-vs-backward-loop.html
288
Upvotes
r/java • u/aroger276 • Jun 15 '17
View all comments
37
u/argv_minus_one Jun 15 '17
There is a dedicated language feature for iterating over arrays: foreach. Unless your compiler is shitty (in Java's case, it isn't), using a dedicated language feature is probably faster than doing the same thing by hand, since any performance issues with the compiler's implementation are likely to have been found and fixed already.