Performance Analysis

A program is slow, yet CPU utilization is only about 20%. What is the most likely cause?

  1. AThe CPU computes too fast
  2. BThe program has too few instructions
  3. CMuch time is spent waiting without using the CPU, for example on disk or network I/O or on locks
Show answer and explanation

Answer: C. Much time is spent waiting without using the CPU, for example on disk or network I/O or on locks

If a program is slow while CPU utilization is low, most of its time is likely spent waiting on something outside the CPU: disk reads and writes, network responses, or locks held by other threads. A faster CPU or optimized computation code would barely help. Effective measures include batching I/O, making it asynchronous so other work proceeds during waits, and shrinking lock scopes.

  • A. Being too fast cannot cause slowness.
  • B. Few instructions do not cause slowness.
  • C. Correct. A faster CPU would not solve it.
Practice this topic Back to topic

More Performance Analysis questions

  1. 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?
  2. When the Roofline model shows a workload in the memory-bandwidth-limited region, which direction improves performance?
  3. What does the STREAM benchmark mainly measure?
  4. What is the most appropriate method for examining a parallel program's scalability?
  5. Running in parallel on 8 cores is 6× faster than on 1 core. What is the parallel efficiency?