5.2.Expressing Program Performance
\(5.2.\)Expressing Program Performance
We introduce the metric cycles per element, abbreviated CPE, to express program performance in a way that can guide us in improving the code.
The time required by a iteration procedure can be characterized as a constant plus a factor proportional to the number of elements processed. Take the following two C programs as an example:
1 | /* Compute prefix sum of vector a */ |