Performance Analysis
Two programs with equal instruction counts run back to back, one at 1000 million instructions per second and the other at 500 million. What is the overall average rate?
- A750 million instructions per second
- BAbout 707 million instructions per second
- CAbout 667 million instructions per second
Show answer and explanation
Answer: C. About 667 million instructions per second
With I instructions each, the times are I ÷ 1000 and I ÷ 500, totaling 3I ÷ 1000. Executing 2I instructions in that time gives an average rate of 2I ÷ (3I ÷ 1000) ≈ 667. The slower program takes longer, pulling the average toward the slower rate. When averaging rates over equal amounts of work, use the harmonic mean, not the arithmetic mean.
- A. Simply averaging the rates arithmetically is wrong.
- B. That is the geometric mean, which does not represent the overall rate.
- C. Correct. Rates are averaged with the harmonic mean.