Processor-limited programs
If the program is processor-limited because it consists almost entirely of numerical computation, the chosen algorithm will have a major effect on the performance of the program.
The maximum speed of a truly processor-limited program is determined by:
- The algorithm used
- The source code and data structures created by the programmer
- The sequence of machine-language instructions generated by the compiler
- The sizes and structures of the processor's caches
- The architecture and clock rate of the processor itself (see Determining microprocessor speed)
A discussion of alternative algorithms is beyond the scope of this topic collection. It is assumed that computational efficiency has been considered in choosing the algorithm.
Given an algorithm, the only items in the preceding list that the programmer can affect are the source code, the compiler options used, and possibly the data structures. The following sections deal with techniques that can be used to improve the efficiency of an individual program for which the user has the source code. If the source code is not available, attempt to use tuning or workload-management techniques.