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. Note that if you are looking at overall utilization on a multicore machine, a single thread fully using one core still shows a low value, so check per-core utilization as well.

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