Definition
A callback §14.22 table is a table of timing results with one row per callback, a function that a system calls whenever one kind of event happens. Each row reports how long the whole callback took and how long its decision window lasted: the part of the callback in which a policy, a set of rules, decides whether the event is allowed. A signed effect is one duration minus another, measured under two conditions and printed with its sign, so a negative value means that the first condition took less time.
Where it fits
Main entry: Estimand and estimator (§11.2).
The entry on estimand and estimator separates the exact quantity that a study wants to know, the estimand, from the estimator, the calculation that approximates that quantity from data. Each cell of a callback table is an estimate, the number that such a calculation returned, and the cell can be read only when its estimand is stated:
which interval was timed, the whole callback or the decision window alone;
per what unit, one callback or one decision;
under which condition, for example with the event allowed or denied;
which summary over repeated runs, such as the median §11.13, the middle value of the sorted durations;
which duration is subtracted from which in a signed effect.
Every decision has its own decision window, and each window lies inside the callback. The callback duration is therefore the time of its decision windows plus the callback’s other work. Suppose a callback makes two decisions that take 2 and 3 microseconds. When the event is allowed, the callback also does 5 microseconds of other work and takes microseconds. When the event is denied, the same decisions run, but the callback skips building a reply, does 1 microsecond of other work and takes microseconds. The signed effect, denied minus allowed, is microseconds, although the decisions cost microseconds in both cases. The sign is negative because the denied path did less other work, not because any work took negative time. All data in this entry’s examples are invented.
Limits and common mistakes
Time per callback and time per decision differ when a callback holds several decisions. In the example, the decisions take 5 microseconds per callback, which is microseconds per decision on average.
A row measured with the policy switched off does not describe software built without the policy code. The switched-off path can still contain the code that checks the switch and the timing code itself. The cost that timing code adds is called instrumentation overhead §11.32.
Rows differ in the event, in the number of decisions and in what a denial does, so they must not be merged into one overhead number.
Questions answered
Why can one callback include two decisions?
One callback can include two decisions because one run of a callback can put more than one question to the policy. A callback is a function that a system calls when an event arrives. A decision is one evaluation of the policy, the set of rules that says whether something is allowed. A callback needs two decisions whenever the one event that it handles amounts to two actions and the policy rules on each action separately. For example, a request that writes a value may, through that value, also switch on a stream of updates. The callback then asks the policy once about the write and once about the stream.
If 100 callbacks each make 2 decisions, a table rests on 100 callback durations and decision durations, so a value quoted per decision must not be read as a value per callback.
Related entries: Instrumentation overhead (§11.32), Paired design (§11.7), Observation versus enforcement (§1.20), Timing endpoints and inclusive versus exclusive windows (§18.1.6), Median (§11.13).