DO NOT RUN IN DEBUG MODE. Rust Playground, I have tried with i2 count down in all spots and it consistently performs best. What I mean by spot is which of first to last test run it is. It is almost a dead heat. In debug mode it is no contest, same one is fastest by a long shot. I challenge everyone to find one way that is consistently better enough.
If we had a reverse for loop or iterator that elides bounds checks might be even faster. I could even optimize further some by making things outside loops only. Why it is all in there is for fairness. I also tried with array.iter().enumerate(), such a fail in performance I took it out. It all measured in nanoseconds for release, in debug it was microseconds before I thousand multiplied counts and array size. Release is like a billion times faster than debug, not exaggerating much. It is consistently for first two trials warming up.
Anyway, yes, I can now prove that this i2-=1 way is fastest to iterate over an array. Prove me wrong with a few trials of anything possibly faster. Hope you enjoyed this and learned something. I am a performance nut so I do these things. It is a megabyte of storage sure but small price to pay to teach everyone that this is fastest as of now. Please use a local machine if you want more data. Feel free to adjust stuff. Maybe try on Vec if you want, or not. Unless there is some great thing I am missing, i2 loop is as fast as it gets.
Note that if you separate it into a loop {} with if i2 == 0 then break it is slower. This pre-decrement rules. X E.