Performance: catch tail latency before users do
For backend and performance engineers, and for anyone who reviews "it's faster" claims, including the ones coding agents make.
Latency is a distribution, not a number. A change can save CPU, make the median faster, and still make the tail seconds slower, and the tail is what users and timeouts see. QA-Board runs the same load profiles on every commit and shows the whole distribution against the reference, where the time went, and the commit that changed it. Your microbenchmarks fit in the same review: QA-Board reads the files your harness and your profiler already write.


What it changes for your team
- Distributions, not averages. Percentiles from p50 to p99.9, under the same load profiles on every commit, the new run's over the reference's.
- Where the time went. Save what your profiler writes (folded stacks, speedscope,
.cpuprofile;perfand pprof through a helper): the flame graph diff shows which functions take a bigger or smaller share, and a table ranks them. CPU per core shows what the workers did. - Microbenchmarks, against the reference. pytest-benchmark, Google Benchmark, hyperfine, Criterion, JMH and
go testresults: each benchmark's change, gray when it's within the spread the harness measured, and a warning when the two ran on different CPUs. - The commit that did it. Trends follows p99 profile by profile, so a regression on one traffic shape doesn't hide in the overall median.
- Settings backed by data. Sweep the server's settings from the browser and pick from the frontier of CPU against p99.
- "It's faster" gets checked.
qa gate(experimental) fails CI when p99 or throughput regress, whether a person or a coding agent wrote the change, and posts its table on the pull request.
See it in action
The pictures come from a demo inference gateway, right after the team's coding agent added a shared result cache. Its commit message says it saves CPU. It does, and the gateway's capacity halves.
Capacity, not only latency
The ramping profile raises the load step by step: with the shared cache, p99 takes off at a lower throughput.


Where the time went
In the flame graph diff, rendering responses under the cache's lock is new (orange), and the model runs less (blue): cache hits skip it. Under the graph, Top functions ranks every function by how much its share of the profile changed. The gateway saves its CPU samples as folded stacks, the format most profilers can write: there is no conversion code (see flame graph formats).


What the cores did
The gateway now runs one batch at a time: its cores idle while requests queue for the lock.


Fail the change in CI
qa gate (experimental) compares the commit's CI batch with the reference, rule by rule, and fails the job: p99 is
dozens of times its reference's, where the rule allows 10% more.
With --post-comment github (or gitlab), the same table goes to the pull request, where the agent's change is
reviewed, and is updated on each push (see comment on pull requests):


Microbenchmarks next to the reference
When a run saves a benchmark harness's file, its card compares each benchmark with the reference run's: the change in
%, the spread both files report, and a count of what got slower, faster, or stayed within noise. A change smaller than
the spread stays gray, never red or green, and a warning says when the two files come from different CPUs. The
geometric mean of the changes sums the suite up, and benchmark_metrics returns each benchmark as a metric, for
Trends and the gate (see benchmarks). The demo gateway has no microbenchmarks yet:
reading benchmarks walks through the viewer.
Find a regression the median hides
Weeks later, a commit that copies payloads makes p99 worse on the heavy-tailed profile only. Filtered on that profile, Trends shows the step; hovering along the line shows each commit's results next to the commit before.
Pick settings from the frontier
A tuning sweep over the batching settings: each configuration's CPU per request against its p99, and the defaults picked on the frontier. Configurations that only differ by noise land apart too, which shows how far apart two must be to differ.


When a run crashes
A crashed run's log opens on its last lines; search it to jump to the panic and the line of code it names.


How it's set up
Plots set their traces' colors, so the web app draws the reference dashed and faded when side_by_side: false overlays
them. The gate's rules are on p99 and throughput.
outputs:
metrics: qa/metrics.yaml
visualizations:
- name: Latency percentiles (log tail)
path: latency_cdf.plotly.json # x: 1/(1-p) on a log axis, labeled 50% 90% 99% 99.9%; y: ms, log
side_by_side: false # overlaid: the reference is dashed and faded
- name: Where the time goes
path: breakdown.plotly.json # stacked bars at p50/p90/p99/p99.9: queue, batch wait, lock wait, compute
- name: Latency over time
path: timeline.plotly.json # p50, p99 and max per 100 ms, queue depth on a second axis
- name: Throughput vs p99
path: sweep.plotly.json # ramp runs only: achieved req/s vs p99, one point per step
side_by_side: false
- name: CPU flame graph
path: cpu.folded # CPU samples as folded stacks, in µs of CPU per 1,000 requests
- name: CPU per core
path: cores.plotly.json # heatmap, cores x time, % busy
default_hidden: true
- name: Batch sizes
path: batch_sizes.plotly.json
side_by_side: false
default_hidden: true
- name: Latency histogram
path: latency_hist.plotly.json # log-spaced bins
side_by_side: false
default_hidden: true
- name: Percentiles
path: percentiles.txt # HdrHistogram's percentile distribution, for text diffs
default_hidden: true
# Experimental: may change without notice
gate:
reference: main
labels: [ci]
rules:
- {metric: latency_p99, max_regression: 10%}
- {metric: throughput, max_regression: 5%}
max_failed_runs: 0
Runs execute one at a time, so they don't measure each other, and each run repeats its measurement: reported percentiles are the median over repeats.
To add microbenchmarks, have run() start the harness and save its file in the output directory, list it in
outputs.visualizations, and return benchmark_metrics(path): see benchmarks for each
harness's command.
What QA-Board doesn't do (yet)
- It doesn't run or stabilize benchmarks. The numbers and their spread are what the harness wrote: configure it for stable measurements (repetitions, warm-up, pinned CPUs), and run new and reference on the same machines. The viewer warns when the files say they come from different CPUs.
- No noise model from past runs. "Within noise" compares a change with the spread of the two files, not with the history of the benchmark. Continuous benchmarking services like CodSpeed or Bencher do more here (see compared with other tools).
- No continuous profiling. Flame graphs come from the profiles your runs save, not from production.
Try it on the demo
examples/serving-latency is a small
inference gateway in Rust: a request queue, dynamic batching, a pool of workers running a CPU model, and a result
cache. An open-loop load generator sends it requests at a fixed rate, with steady, bursty, heavy-tailed and ramping
profiles. Each run measures latency percentiles, throughput, CPU per request and queueing, and records CPU samples for
a flame graph.
The story the pictures tell
- The team's coding agent adds a shared result cache. It saves about a third of the CPU per request, but the workers keep the cache's one lock while they run the model and render responses. Capacity halves: at 6,000 requests/s, requests wait seconds. The quality gate fails.
- The flame graph diff shows the responses rendered under the cache's lock, and the model work the cache saves.
- Sharding the cache by key fixes p99 and makes the median faster. A tuning sweep then picks the batching settings.
- Later, a commit that copies payloads makes p99 worse on the heavy-tailed profile only: the median over all profiles barely moves, and Trends finds it.
You need Rust (stable) and a Linux machine with 4 CPUs or more. The first run builds the gateway and sizes its model to your machine, so the load levels mean the same thing everywhere.
cd examples/serving-latency
pip install qaboard # qa/main.py only needs the standard library and PyYAML
qa run --input profiles/steady-high.yaml # 6,000 requests/s, about 10 s
qa batch ci # 5 load profiles, about 45 s
qa batch ci shows the results in the web app. With the
quickstart's server, first
export QABOARD_URL=http://localhost:5151 QA_STORAGE=/tmp/qaboard.
Close what you can while it runs: a busy laptop makes for a slow gateway and noisy tails. See the example's README for the other batches.
Where next
- User guideFlame graphs and benchmarksHow to read them against the reference.
- Project integrationProfiles and benchmark filesSave what your profiler and your harness write.
- User guideTrendsMetrics across commits, per test or aggregated.
- Project integrationThe quality gateFail CI when a metric regresses. Experimental.