Extract Procedure Calls from Loops

It is ine￿cient to code a loop containing only a procedure call because of the required overhead by each procedure call. It is a recommended programming practice to code the loop inside the procedure. Figure 5-7 sho ws an example of extracting a procedure call from a loop.

Figure 5-7. Extracting Calls from Loops

Avoid Non-native AlignmentFigure 5-8 sho ws an example of a voiding non-nativ e alignment.

Figure 5-8. Avoiding Non-native Alignment

5-8 Optimizing a Program