If you know the possibility (roughly is ok) of the condition checks, you can sort them in descending order, which improves the cache (pre fetching, decreases the chances of …
Unrolling the Loop can be considered the simple-but-effective optimisation method. Usually, the operations done in a loop can be grouped into two or more. In this case, unrolling them …