Frame-time percentiles: why sample length matters

Updated

Report the rule, sample count and time series with the percentile. A smooth-looking tail summary does not erase an observed hitch.

Scope: Original nearest-rank examples using fictional measurements. Other tools may use interpolation or different percentile and low-FPS definitions.

A percentile is a position in an ordered sample, not a complete description of a run. Recording length and the calculation rule both affect what its tail can represent.

State the rule before using the label

For this example only, sort frame times from smallest to largest and select rank ceil(p × N), where N is the frame count and p is the percentile as a fraction. A larger frame time means a slower frame.

At p = 0.99 and N = 100, the rank is 99. The selected value is the second-largest observation. At N = 1000, the rank is 990, leaving 10 observations strictly after that rank; ties may share its value.

A short tail is fragile evidence

In a fictional ordered sample with 99 frames at 10 ms and 1 frame at 100 ms, nearest-rank p99 is 10 ms. The single 100 ms hitch still occurred. Reporting p99 alone would hide it.

Now append one more 100 ms frame to that fictional sample. There are 101 frames, and ceil(0.99 × 101) selects rank 100. With 99 frames at 10 ms and 2 at 100 ms, p99 becomes 100 ms. The displayed statistic has jumped from 10 ms to 100 ms after one added observation. Keep both the count and the timeline: the change describes the sample and rank rule, not a tenfold slowdown of every frame.

Compare matched recordings and the timeline

Record the scene, duration, frame count and percentile method. Use the same method on comparable runs and inspect the timeline for loading, pauses and isolated spikes. Declare any exclusions consistently rather than removing inconvenient frames after seeing the result.

If two tools disagree, first compare their input samples and calculation definitions. Do not convert a percentile frame time into a named low-FPS metric unless that metric's definition justifies the operation. Retain the actual frame-time value, units and sample count alongside the summary.