Performance Analysis
To check whether a program is compute-bound or memory-bound, its run time is measured at different CPU frequencies. What is the typical result if it is memory-bound?
- ARun time shrinks in inverse proportion to frequency
- BRaising frequency barely shortens run time
- CRaising frequency lengthens run time
Show answer and explanation
Answer: B. Raising frequency barely shortens run time
A compute-bound program spends its time computing inside the CPU, so raising frequency 1.5× cuts run time to about 1/1.5. A memory-bound program spends most of its time waiting for data from main memory, and that wait does not change with CPU frequency, so run time barely changes. Combined with performance counters, this tells which kind of improvement deserves the effort.
- A. That is the compute-bound result.
- B. Correct. Memory speed does not change with CPU frequency.
- C. Raising frequency does not normally slow things down.