TactivergeLite

Lite / Engineering Complex Systems / Week 34

A speed-up is a ratio: give it an interval

1.29× faster. Plus or minus what? And is 1.0 inside the interval?

About 35 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

Speed-ups, efficiency gains and energy savings are ratios of two measured quantities. Last fortnight's propagation rules turn into a tool you will use in every results table of your term project.

Predict

A: 40.0 ± 0.4 ms, B: 31.0 ± 0.6 ms (standard errors). Which is the speed-up's standard uncertainty?

  1. About 0.01
  2. About 0.03
  3. About 0.10
  4. About 1.0
Guess first, then reveal

S = 40/31 = 1.290. Relative uncertainties: 1.0% and 1.94%; combined √(1.0² + 1.94²) ≈ 2.18%. δS ≈ 1.290 × 0.0218 ≈ 0.028.

Discover

Choose A ÷ B. Set A = 40 with δA = 0.4 (1%) and B = 16 with δB = 0.3 (about 1.9%): the same relative uncertainties as the benchmark below, so the ratio's relative uncertainty is the same too. Read it off, then increase δB and watch it grow. Finally open the benchmark checker and compare its interval with your hand calculation.

What the interactive shows (text version)

The uncertainty calculator in quotient mode shows A ÷ B with its propagated uncertainty and a Monte Carlo histogram. For A = 40 ± 0.4 and B = 16 ± 0.3 the ratio is 2.5 with a relative uncertainty of about 2.2%, the same relative uncertainty as a 40 ± 0.4 ms against 31 ± 0.6 ms benchmark, and the simulation agrees with the formula. Raising δB widens the histogram and eventually skews it, which is when the symmetric formula becomes unreliable.

You can also open the interactive on the full site when you have a faster connection.

Understand

From two means to one ratio

Speed-up S = t_A/t_B. With independent standard errors SE_A and SE_B: δS/S = √((SE_A/t_A)² + (SE_B/t_B)²). A 95% interval is S ± 1.96·δS. If the interval lies wholly above 1, B is faster at that confidence; if it includes 1, the data don't show a speed-up.

Compare against what matters

Statistical clarity is not the same as practical value. An interval of 1.02–1.04 is confidently above 1 but may not justify a risky change. Compare the interval with the threshold you set in your decision rule (say 1.10), not just with 1.

Ratios of noisy numbers misbehave

The quotient rule is first order. If B's relative uncertainty exceeds about 10%, the distribution of t_A/t_B is skewed and the symmetric interval misleads; use more repeats, or resample (bootstrap) the runs. Also beware averaging per-run speed-ups: the mean of ratios is not the ratio of means.

Report completely

A good line in a results table: 'Speed-up (median time, B vs A) 1.29 [1.24, 1.35], 95% CI by quotient propagation; n = 30 runs each after 3 warm-up, interleaved; same 4 MB input; laptop on mains, fixed performance mode.' Anyone can judge it, and anyone can try to reproduce it.

Explain it another way

Intuitive

Two wobbly measurements make a wobblier ratio. The percentages of wobble combine, like the sides of a right-angled triangle.

Technical

Delta-method variance of a ratio: Var(A/B) ≈ (μ_A/μ_B)²·(Var A/μ_A² + Var B/μ_B² − 2Cov(A, B)/(μ_Aμ_B)). Paired, interleaved runs can make A and B positively correlated, which reduces the variance of their ratio.

Mathematical

Log transform: ln S = ln t_A − ln t_B, and δ(ln t) ≈ δt/t. So δ(ln S) = √((δt_A/t_A)² + (δt_B/t_B)²), and an interval on ln S exponentiates to an asymmetric interval on S, which behaves better for large uncertainties.

Applied

Compiler teams track performance across thousands of benchmarks every night and flag a change only when the measured slowdown exceeds the run-to-run noise they've characterised for that benchmark.

Worked example 1

A = 60.0 ± 1.2 ms, B = 50.0 ± 1.5 ms. Speed-up, uncertainty and 95% interval. Does it clear a 1.10 threshold?

S = 1.200. Relative: 2.0% and 3.0%, combined 3.6%. δS = 0.043. 95%: 1.200 ± 0.085 → 1.115 to 1.285. It clears 1.10, narrowly.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

×

×

Practice 3. A speed-up is reported as 1.08 with 95% interval 0.97–1.19. What should the report conclude?
Practice 4. Why not compute the speed-up as the average of per-run ratios t_A,i / t_B,i?

Apply it

Take the benchmark checker's fair configuration, run five seeds, and record S ± δS for each. How many intervals contain the true 1.29? Write a results-table line in the format above for your best-documented run.

Reflect

When would you report a speed-up interval on a log scale rather than a linear one?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Designing a benchmark you can trustWhich part made it better? Baselines and ablations →