Use these techniques for performance improvements:
Move loop invariants outside the loop.
Make the tests as simple as possible.
Use only local variables inside a loop; assign class fields to local variables before the loop.
Move constant conditionals outside loops.
Combine similar loops.
If loops are interchangeable, nest the busiest one.
As a last resort, unroll the loop.