Performance Analysis

When measuring performance on multicore or NUMA systems, why are threads sometimes pinned to specific cores (setting affinity)?

  1. AWhen the OS migrates threads between cores, cache contents are lost or remote memory is used, making results vary
  2. BPinning doubles the number of cores
  3. CWithout pinning, the program cannot run
Show answer and explanation

Answer: A. When the OS migrates threads between cores, cache contents are lost or remote memory is used, making results vary

The OS sometimes migrates threads to other cores to balance load. The destination core's cache lacks the needed data, and on NUMA systems the thread may land on a socket far from the memory holding its data. So the same program's time varies with which cores it ran on. Pinning threads to cores and also fixing memory placement improves the reproducibility of measurements.

  • A. Correct. It keeps measurement conditions consistent.
  • B. The core count does not change.
  • C. Programs run without pinning.
Practice this topic Back to topic

More Performance Analysis questions

  1. When analyzing the performance of a GPU program, what is the most appropriate thing to check first?
  2. When choosing servers for a data center, which is NOT a consideration beyond peak performance?
  3. When evaluating a claim that "the new method is 100× faster," what is most important to check?
  4. Why is SSD performance often stated not only as sequential read bandwidth (MB/s) but also as 4 KB random-read IOPS (I/O operations per second)?
  5. Measuring per-element time for repeatedly reading an array while gradually growing its size shows time rising in steps at certain sizes. Why?