Section 18.3.4

Post-gate event overhead bars

Definition

A post-gate event overhead bar chart is a figure that shows, for each kind of event a system handles, two bars: the mean time to handle the event with a feature turned off, called the baseline, and the mean time with the feature turned on. Post-gate means that the timer starts at a gate, a chosen place in the code path, so neither bar includes work done before that point. The overhead is the enabled bar minus the baseline bar: the time that the feature adds inside the timed window.

Where it fits

Main entry: Effect size (§11.24).

The effect size entry explains how to state how large a difference is, chiefly as an absolute difference (enabled minus baseline, in time units) or as a ratio (enabled divided by baseline). This figure shows why the choice matters when the baseline is close to zero.

On a linear axis that starts at zero, a bar’s height is proportional to its value. In an invented panel, the baseline mean is 1.2 μ\mus (microseconds), the enabled mean is 96 μ\mus, and the axis runs from 0 to 100 μ\mus over 240 pixels, which is 2.4 pixels per microsecond. The enabled bar is 96×2.4=230.496 \times 2.4 = 230.4 pixels tall. The baseline bar is 1.2×2.4=2.881.2 \times 2.4 = 2.88 pixels tall, about the thickness of the axis line it stands on. The baseline is small, not absent; only its printed value shows how small.

A small baseline makes a ratio unstable. Let the baseline’s 95% confidence interval §11.18, the range of plausible values for its true mean, run from 0.7 to 1.7 μ\mus, and hold the enabled mean at 96 μ\mus. Across that interval the absolute difference moves only from 96−1.7=94.396 - 1.7 = 94.3 to 96−0.7=95.396 - 0.7 = 95.3 μ\mus, about 1%. The ratio moves from 96/1.7≈5696 / 1.7 \approx 56 to 96/0.7≈13796 / 0.7 \approx 137, more than a factor of 2. The percent overhead §18.1.13 at the means, (96−1.2)/1.2×100=7900%(96 - 1.2) / 1.2 \times 100 = 7900\%, describes the tiny denominator more than the feature. When the disabled path does almost nothing inside the window, the baseline measures little more than the cost of reading the timer, and timer quantization §11.35, the rounding of every reading to whole timer ticks, distorts it.

The overhead is measured only inside the window. Work that the feature adds before the gate, or after the timer stops, appears in neither bar, so a claim about the feature’s cost for the whole event needs a window that encloses all of that work. The enabled bar is a total duration, not the overhead; labeling the whole bar as overhead mixes the two.

Three displays keep the baseline readable: a printed value beside each bar; a separate, clearly labeled panel with its own axis for the small values; or a plot of the differences themselves, each with its own interval. A logarithmic axis §18.1.12, on which equal distances mean equal ratios, shows 1.2 and 96 μ\mus at readable sizes, but on such an axis a bar’s length depends on the arbitrary lower end of the axis, so points serve better than bars, and zero cannot be drawn at all. The entry on logarithmic axes and multiplicative differences explains such axes.

All data in this entry’s examples are invented.

Limits and common mistakes

Both bars must measure the same event, the same input, the same outcome, such as an allowed or a rejected input, and the same window, with only the feature changed. A mean for allowed inputs says nothing about rejected or malformed inputs, which take a different path through the code.

A mean bar hides the spread of single measurements and any long tail of slow cases.

Questions answered

Why is the baseline bar hard to see?

The baseline bar is hard to see because it shares a linear axis with a bar many times taller, and on a linear axis that starts at zero a bar’s height is proportional to its value. A baseline of 1 μ\mus (microsecond) beside an enabled bar of 100 μ\mus gets one hundredth of the height: in a panel 200 pixels tall, 2 pixels, about the width of the axis line. Hard to see does not mean zero, so read the printed value before concluding that the baseline costs nothing. When the disabled path does almost nothing inside the timed window, the bar is small for exactly that reason.

The small value still matters, because it is the denominator of every ratio. The ratio is 100/1=100100 / 1 = 100 and the absolute difference is 100−1=99100 - 1 = 99 μ\mus. An error of 0.5 μ\mus in the baseline moves the ratio anywhere from 100/1.5≈67100 / 1.5 \approx 67 to 100/0.5=200100 / 0.5 = 200, but the difference only from 98.5 to 99.5 μ\mus. Report the baseline’s value and the absolute difference with its own confidence interval, and if the small bar must be seen, give it its own labeled panel.

Related entries: Estimand and estimator (§11.2), Confidence interval (§11.18), Resolution versus precision versus accuracy (§11.34), Logarithmic axes and multiplicative differences (§18.1.12), Contrast, normalization, ratio, and percent overhead (§18.1.13), Counter quantization (§11.35).