In a high-level language view, you will not see optimization. The increase in speed comes from what the compiler does with what you have.
In the first case, it is something like:
LOCATION_FLAG;
DO_SOMETHING;
TEST FOR LOOP COMPLETION;//Jumps to LOCATION_FLAG if false
In the second, it is something like:
LOCATION_FLAG;
DO_SOMETHING;
DO_SOMETHING;
DO_SOMETHING;
TEST FOR LOOP COMPLETION;//Jumps to LOCATION_FLAG if false
, 1 3. 1 1; .
, , ( mod 3, ), , .