Performance Analysis

A new compiler optimization reduces executed instructions by 20% but increases average CPI by 10% (frequency unchanged). What is its effect?

  1. AIt is always slower because CPI rose
  2. BExecution time becomes 0.8 of the original
  3. CExecution time becomes 0.88 of the original, so it is faster
Show answer and explanation

Answer: C. Execution time becomes 0.88 of the original, so it is faster

Execution time is proportional to instruction count times CPI, so it becomes 0.8 × 1.1 = 0.88, about 12% shorter. Improving one factor often worsens another, as when using complex instructions reduces their number but increases the work per instruction. Judging by CPI or instruction count alone is misleading, so the product must be compared.

  • A. The instruction reduction outweighs the CPI rise.
  • B. That forgets the CPI increase.
  • C. Correct. 0.8 × 1.1 = 0.88.
Practice this topic Back to topic

More Performance Analysis questions

  1. 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?
  2. When comparing CPU performance by instructions executed per second (millions of instructions per second), what should be kept in mind?
  3. How is speedup, which expresses a performance improvement, calculated?
  4. A part taking 50% of total time is made 4× faster. What is the overall speedup (Amdahl's law)?
  5. You want to make an entire task 2× faster by speeding up only the part that takes 60% of the time. How many times faster must that part become?