Program optimization [Aho, Sethi, and Ullman, Compilers: Principles, Techniques, and Tools, Addison-Wesley, 1988, Ch. 10; Marvin Schaefer, A Mathematical Theory of Global Program Optimization, Prentice-Hall, 1973.] can be defined as follows:
Given a program P, produce a program P' that produces the same output values as P for a given input, but has a lower cost.
Typical costs are execution time and program space. Time is usually more important; fortunately, the two usually go together.
Optimization is an economic activity:
Amount saved by the code improvement * number of occurrences in code * number of repetitions in execution * number of uses of the compiled code
Contents    Page-10    Prev    Next    Page+10    Index