Performance Analysis

Two programs with equal instruction counts run back to back, one at 1000 MIPS (1 billion instructions per second) and the other at 500 MIPS. What is the overall average rate?

  1. A750 MIPS
  2. BAbout 707 MIPS
  3. CAbout 667 MIPS
Show answer and explanation

Answer: C. About 667 MIPS

With I instructions each, the times are I1000I ÷ 1000 and I500I ÷ 500, totaling 3I10003I ÷ 1000. Executing 2I instructions in that time gives an average rate of2I3I1000≈6672I ÷ (3I ÷ 1000) ≈ 667MIPS. 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.