9.13 Performance and scaling measurement
Speed claims require a frozen workload and matched accuracy. Measure wall time, CPU time, memory, output volume and numerical agreement. Report hardware, OS, executable hash, warm-up policy and repetition statistics.
Amdahl's limit
If fraction \(p\) is parallelizable, ideal speedup on \(N\) threads is
Parsing, setup, report generation and file writing remain serial or bandwidth-limited. Small jobs can become slower with extra threads because scheduling and contention exceed saved computation.
Chapter 9 measurement
The retained one-shot end-to-end timings were approximately 0.226 s at 1 thread, 0.238 s at 2 and 0.178 s at 4: speedups 1.00×, 0.95× and 1.27×. The exact values are machine- and load-specific. The fixture emphasizes determinism, not stable microbenchmarking; its output writing is a substantial fraction of runtime.
Better benchmark design
For publishable performance results:
- use representative small, medium and large datasets;
- run warm-ups and multiple randomized-order repetitions;
- report median and dispersion, not only the best run;
- separate compute-only from full workflow timing;
- verify output agreement after every variant;
- monitor CPU utilization, memory and I/O;
- compare software with matched methods, tolerances and outputs.
Common mistakes
- Reporting one favorable timing as a scaling curve.
- Comparing programs that write different outputs.
- Increasing speed by weakening convergence or tolerance settings.
Checklist
- Freeze workload, accuracy controls and environment.
- Repeat and randomize benchmark order.
- Report negative scaling honestly.
Further reading
See parallel architecture, thread determinism and floating-point differences.