Timing More Than One Input Size

Measurements at several input sizes help distinguish work primarily driven by fixed overhead from work growing with the input.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace model values
  2. Keep other dimensions controlled
  3. Compare how time grows with input size
  4. Keep input distribution and output work comparable

Trace model values

Suppose elapsed work looks like \(10+2n\) in a stable environment. Moving from n=5 to n=10 changes predicted time from 20 to 30. See constant terms and growth.

Keep other dimensions controlled

Larger input may also change output size, cache state, or branching. Match representative cases and record those features. Asymptotic input models help identify independent parameters.[1]

Compare how time grows with input size

Two methods measured on 100 records may finish at similar times. At 1000 and 10000 records, one may grow much faster. Use a series of sizes plus comparable data characteristics to identify the range where a difference emerges. See empirical scaling.

Hypothetical rates, smaller to larger
A: 2, 4, 20 ms
B: 2, 6, 85 ms
Equal first measurement does not imply similar later behavior

Keep input distribution and output work comparable

If larger samples also contain different key patterns, size is not the only changed property. Record both dimensions and repeated measurements. Use operation counts for an independent explanation.

References

  1. Google, Site Reliability Engineering ↩