Performance Analysis

A program executing 1 billion instructions runs on a CPU with average CPI 2 and clock frequency 2 GHz. What is the execution time?

  1. A4 seconds
  2. B0.25 seconds
  3. C1 second
Show answer and explanation

Answer: C. 1 second

The required cycle count is instruction count × CPI = 1 billion × 2 = 2 billion cycles. A 2 GHz CPU advances 2 billion cycles per second, so execution time is 2 billion ÷ 2 billion = 1 second. If cache misses raised CPI to 3, the same program would take 1.5 seconds; raising frequency to 3 GHz would bring it to about 0.67 seconds. This formula lets improvements be estimated numerically.

  • A. That multiplies by frequency instead of dividing.
  • B. That divides by CPI.
  • C. Correct. 10⁹ × 2 ÷ (2 × 10⁹) = 1.
Practice this topic Back to topic

More Performance Analysis questions

  1. A CPU design change raises clock frequency 1.5× but also raises CPI 1.2× (instruction count unchanged). How many times faster is execution?
  2. A new compiler optimization reduces executed instructions by 20% but increases average CPI by 10% (frequency unchanged). What is its effect?
  3. A program's instruction mix is 50% integer ALU (CPI 1), 30% loads and stores (CPI 2) and 20% branches (CPI 5). What is the average CPI?
  4. When comparing CPU performance by instructions executed per second (millions of instructions per second), what should be kept in mind?
  5. How is speedup, which expresses a performance improvement, calculated?