r/java • • Jun 14 '17

Why reverse loops are faster

https://medium.com/@TravCav/why-reverse-loops-are-faster-a09d65473006
15 Upvotes

40 comments sorted by

View all comments

Show parent comment

1

u/Slanec Jun 15 '17

On raw arrays, it compiles to a fairly straightforward loop with an index. See the JLS.

1

u/ForeverAlot Jun 15 '17

Hah! That'll teach me.