Performance Analysis
A new compiler optimization reduces executed instructions by 20% but increases average CPI by 10% (frequency unchanged). What is its effect?
- AIt is always slower because CPI rose
- BExecution time becomes 0.8 of the original
- 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.