Repeating Short Measurements
Short operations may be comparable to timer or scheduling noise. Repeated measurements can reveal the range and reduce sensitivity to one observation.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace one anomalous run
If observations are 4, 5, 4, and 20 milliseconds, a single sample of 20 suggests a different result from most runs. Outliers and errors explain why an unusual time deserves context.
Keep the measurements interpretable
Report the process, workload, and sample count. Repeated operations in one run can also warm caches, so compare like states. Cold and warm timing describes that change.[1]
Estimate the signal relative to timer and scheduling variation
A single conversion takes roughly as long as the timing overhead. Timing a batch of many independent conversions can give a clearer mean, provided each does useful work and batching effects are accounted for. Repeat the batch to see ordinary variation. See defining a measured operation.
Run a fixed batch of conversions
Check one actual result or count without changing core work
Repeat across multiple measured batches
Report per-operation quantity and spread
Verify the compiler or runtime did not remove the work
A loop whose results are unused may differ from the real operation. Keep a suitable consumer or verification step. Separate setup costs and report whether batching improves cache locality.