Skip to content
Tech Intuition
Tech Intuition

Appearance

Theme

Signal · Dark with amber

Background

Slow stars and the odd comet

Connect

Case studies · Lesson 39 of 44

Case study: design a performance testing platform

Design the system that runs benchmarks on every change, tells a real regression from noise, finds the commit and routes it to an owner: tiers, noise control, change-point detection, bisecting, hardware pools and cost, with tested C#.

Case studyApplied23 min readUpdated

  • 1 architecture diagram
  • 1 sequence flow
  • 2 data models
  • 1 API design
  • 4 code samples
  • 7 interviewer follow-ups
  • 3 self-checks

Read first: Latency, throughput and queues, Load testing and benchmarking, Profiling and finding the bottleneck

By the end you will be able to
  • Run the full design framework on a platform whose product is trust, not throughput.
  • Tier the tests by cost and noise, and size the hardware pool with Little's Law.
  • Explain why a fixed threshold on one run fails, and detect sustained changes with change-point detection.
  • Find the offending commit with batching and bisecting, and say what each step costs.
  • Handle the senior follow-ups: slow creep, cloud versus bare metal, lab hardware, and connecting lab results to production.

3 code samples (137 lines), collapsed so the explanation stays in focus.

Every team that cares about speed eventually builds this system, and most build it wrong the first time. It runs benchmarks on every change, and a regression appears on a dashboard that nobody reads, because it cried wolf twice last month. This case study designs the version that people trust. It applies the whole performance section: precise measurement and queueing, honest load tests and profiling.

HLD

Clarify the problem

Spend the first minutes on questions. Each answer changes the design.

AskWhy it matters
What is under test: services, libraries, a database, a device with hardware?Decides the runners. Physical test beds with traffic generators are a different scheduling problem from containers
What changes trigger a run, and how fast must feedback be?Per pull request, per merge, nightly, per release. Each has a different cost and a different noise tolerance
What do we measure: latency percentiles, throughput at an SLO, CPU or memory per request, startup time?Metrics differ hugely in noise. The least noisy one that still moves with the thing you care about is the gate
Who acts on a regression, and what is the policy: block the merge, open a ticket, page?The policy sets how much false-positive rate you can afford
How many benchmarks, services and commits per day?Decides whether you can run everything on everything
Is there production-like hardware available, or only the cloud?Noise, cost and how much the lab numbers mean

Functional: define benchmarks as code, trigger them from source control and schedules, run them on controlled hardware, collect latency histograms and resource counters with the environment's fingerprint, compare any two builds, detect regressions and improvements, find the commit, notify the owner, and keep the history. Non-functional: a very low false-alarm rate, enough sensitivity to catch a 3% shift on stable benchmarks, reproducible runs, feedback within an hour of a merge, a hardware cost the company will pay, and an audit trail from every alert to the raw data.

HLD

Estimate the load and the fleet

State assumptions out loud; they are illustrative and the interviewer may change them. The point is to find where the cost sits.

Example · estimate
suite:         1,000 benchmarks (800 micro, 200 macro), 50 services
merges:        500 commits a day, tested in 48 batches (every 30 min)
per batch:     ~20 affected macro benchmarks x 3 repeats x 10 min
               = 600 machine-minutes
batches a day: 48 x 600 = 28,800 machine-minutes = 480 machine-hours
nightly full:  200 macro x 5 repeats x 10 min = 10,000 min = 167 hours
pool:          (480 + 167) h / 24 h = 27 busy hosts
               at 70% target utilization = ~39 hosts
no batching:   500 commits x 200 macro x 3 repeats x 10 min
               = 3,000,000 min = ~2,100 hosts at best
results:       ~4,000 runs a day x 20 metrics = under 100,000 rows a day
raw artifacts: histograms ~5 KB a run = ~20 MB a day
               profiles ~500 KB each = ~2 GB a day if all are kept

Three things follow. You cannot run everything on everything (2,100 hosts against 39), so tiering, test selection and batching are the design. The pool size is Little's Law with a utilization target: runs per day × minutes per run ÷ minutes per day ÷ utilization. And storage is a footnote. The summary data fits in any database, and raw profiles are kept for flagged runs and a sample. The cost is hosts, and the scarce resource is trust.

LLD

The contract: benchmarks, results and comparisons

A benchmark is a versioned package, not a script on someone's laptop: a container image or build target, a manifest with its workload (an open-loop rate, as in the load testing lesson), duration and warm-up, the metrics it emits as histograms, the hardware class it needs, its owners, and a noise budget that the platform fills in from measurements.

runSQL table
  • run_iduuid

    PK
  • benchmark_idtext

    INDEX
  • batch_idtext

    the merge batch this run measured

    INDEX
  • commit_firsttext

    first commit of the batch, in merge order

  • commit_lasttext

  • pooltext

    hardware class, for example bare-metal-a

  • host_idtext

  • fingerprintjson

    CPU model, SMT, governor, kernel, runtime, config hash

  • statustext

    ok, or invalid (host failed calibration, agent died)

  • started_attimestamp

Runs for two builds being compared are interleaved on the same hosts, so host_id is part of every comparison.

metric_pointcolumnar store, partitioned by benchmark_id
  • benchmark_idtext

    PK
  • metrictext

    p99_ms, throughput_rps, cpu_ms_per_request, alloc_bytes_per_request

    PK
  • commit_seqint

    position in merge order: the x-axis for change detection

    PK
  • run_iduuid

    FK→ run.run_id
  • valuefloat

The x-axis of every series is commit order, not wall-clock time. A change point then points at commits, and a run delayed by a busy pool still lands in the right place.

POST/v1/compare
auth
service account, scoped to the benchmark's team
body
{ "benchmark": "checkout-api/steady-3k", "baseline": "build-4812", "candidate": "build-4819", "runs": 10 }
note
runs are interleaved A, B, A, B on the same hosts, and the answer is a confidence interval, not a verdict
  • 202queued; the result link carries the interval, the effect size and the raw histograms

HLD

The high-level design

Fig. Performance platform: triggers in, trusted regressions out
Fig. Performance platform: triggers in, trusted regressions out
Fig. From a merge to a ticket
Fig. From a merge to a ticket

The flow: CI says a batch is ready; the scheduler matches jobs to hardware classes; a runner agent on a calibrated, pinned host deploys the system under test and starts the load generator (a separate host, so the generator never competes with the target); results go to the object store as histograms and to the metrics store as per-run summaries; the analysis service compares runs with the series and decides; a suspected range goes to the bisect service; confirmed regressions go to triage with evidence attached.

HLD

Tiers: which tests run when

TierWhenWhatHardwareGate
0Every pull requestMicrobenchmarks selected by the changed paths, using low-noise metrics: allocations, instructions, operationsShared CI fleetBlock only for big, certain regressions (say 15% or more), because noise is high here
1After merge, per batchThe affected macro benchmarks, 3 interleaved repeatsDedicated, calibrated bare metalStatistical detection, automatic bisect, ticket
2Nightly and weeklyThe full macro suite, capacity ramps, soak tests, multi-nodeDedicated pool and a scale environmentCompare with the last release and the previous night
3Release candidate and productionCanary analysis against SLOs (see SLOs and burn rates), continuous profiling diffsReal trafficRoll back on SLO burn

The idea is a cost ladder. Cheap and noisy tests run often and only block when certain; expensive and trustworthy tests run less often and carry the detection. Test selection (map changed files to the benchmarks that depend on them) and batching (test the head of a batch, then bisect inside it when something moves) are what turn 2,100 hosts into 39.

HLD

Deep dive: noise is the product

If two runs of the same build differ by 3%, no shift under 3% is detectable, and every alert is a coin toss. Noise is therefore the first thing to measure and manage.

  • Where it comes from. Hardware (turbo and frequency changes, SMT siblings, NUMA placement, thermal limits), the operating system (daemons, interrupts, scheduling), the runtime (JIT warm-up, garbage collection timing), memory layout (changes that should not matter, like environment size or code placement, shift results), cloud neighbors and the network.
  • Control what you can. Bare metal or dedicated hosts for gating tests, a fixed frequency governor and a documented turbo policy, SMT off or workload pinned to cores, nothing else running, a freshly imaged or cleaned host for each job, the load generator on its own machine.
  • Calibrate hosts. Before each job, run a fixed reference workload. If a host's score drifts from its own history, drain it. A "bad host" explains many mysterious regressions.
  • Record the fingerprint (CPU model, kernel, runtime version, configuration hash) with every run. When the fingerprint changes, annotate the series. A kernel upgrade is not a regression in your code.
  • Measure each benchmark's noise with A/A runs (the same build twice) and publish it. Classify: stable (under about 1% run to run), usable (1% to 3%), noisy (above). Only stable benchmarks gate. Noisy ones are trend-only until their owners reduce the noise, and the platform shows the noise next to the result so no one over-reads it.
  • Pick metrics with care. CPU time per request, allocation per request and instruction counts are far steadier than p99 latency, so gate on them and keep tail latency as a guardrail with a looser threshold. Prefer the quietest metric that still moves when the thing you care about moves.
  • Spend runs where the noise is. From the load testing lesson, detecting a shift δ with run-to-run deviation σ needs about 16 × (σ ÷ δ)² runs per side. Noisier benchmarks get more repeats, or a bigger minimum effect.

LLD

Deep dive: detecting a real change

The tempting rule is a threshold: alert if the newest run is more than 3% slower than the baseline. With 3% noise, that fires on about one build in five for nothing. Averaging a few baseline runs helps a little; the real fix is to stop judging single points.

Treat the per-batch results as a time series in commit order and ask a different question: has the level of this series changed, and where? That is change-point detection. MongoDB has published how it applies it to its CI performance results (using the E-Divisive means algorithm) and routes the output to a triage team. A compact version for a mean shift works like this:

  1. For every possible split point, compare the two sides with a t-like statistic. Keep the split that separates them best, and require a minimum segment length so one wild run cannot be a segment.
  2. Ask whether such a split could appear by chance in this noise: shuffle the values many times, recompute the best statistic, and take the fraction of shuffles that do as well (a permutation test). Accept the split only if that fraction is small.
  3. Require a minimum effect size, so a statistically real 0.3% shift does not page anyone.
  4. Recurse on both sides, so a regression followed by a fix gives two change points.
C# · Synthetic, ChangePoints85 lines
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

public static class Synthetic
{
    /// <summary>`n` results around `mean` with run-to-run noise `sd` (a bell curve, via Box-Muller).</summary>
    public static double[] Normal(Random g, int n, double mean, double sd)
    {
        var xs = new double[n];
        for (int i = 0; i < n; i++)
            xs[i] = mean + sd * Math.Sqrt(-2 * Math.Log(1 - g.NextDouble())) * Math.Cos(2 * Math.PI * g.NextDouble());
        return xs;
    }
}

public static class ChangePoints
{
    /// <summary>The split of xs[lo..hi) into two parts whose means differ most, scored as a t statistic.
    /// Returns (-1, 0) when the range is too short for two segments of `minSegment` points.</summary>
    public static (int Index, double Statistic) BestSplit(double[] xs, int lo, int hi, int minSegment)
    {
        int n = hi - lo;
        if (n < 2 * minSegment) return (-1, 0);
        var sum = new double[n + 1];
        var sumSq = new double[n + 1];
        for (int i = 0; i < n; i++)
        {
            sum[i + 1] = sum[i] + xs[lo + i];
            sumSq[i + 1] = sumSq[i] + xs[lo + i] * xs[lo + i];
        }
        int best = -1;
        double bestT = 0;
        for (int k = minSegment; k <= n - minSegment; k++)
        {
            double n1 = k, n2 = n - k;
            double m1 = sum[k] / n1, m2 = (sum[n] - sum[k]) / n2;
            double sse = (sumSq[k] - n1 * m1 * m1) + ((sumSq[n] - sumSq[k]) - n2 * m2 * m2);   // spread within the two sides
            double pooled = Math.Max(sse / (n - 2), 1e-12);
            double t = Math.Abs(m2 - m1) / Math.Sqrt(pooled * (1 / n1 + 1 / n2));
            if (t > bestT) { bestT = t; best = lo + k; }
        }
        return (best, bestT);
    }

    // The chance of seeing a best split this good in the same values in random order: a permutation test.
    private static double PValue(double[] xs, int lo, int hi, int minSegment, double observed, int permutations, Random random)
    {
        var copy = new double[hi - lo];
        Array.Copy(xs, lo, copy, 0, copy.Length);
        int atLeastAsGood = 0;
        for (int p = 0; p < permutations; p++)
        {
            for (int i = copy.Length - 1; i > 0; i--)
            {
                int j = random.Next(i + 1);
                (copy[i], copy[j]) = (copy[j], copy[i]);
            }
            if (BestSplit(copy, 0, copy.Length, minSegment).Statistic >= observed) atLeastAsGood++;
        }
        return (atLeastAsGood + 1.0) / (permutations + 1);
    }

    /// <summary>Indexes where the level of the series changed, found by recursive splitting (binary segmentation).</summary>
    public static List<int> Detect(double[] xs, int minSegment, double alpha, int permutations, int seed, double minRelativeChange)
    {
        var random = new Random(seed);
        var found = new List<int>();
        void Segment(int lo, int hi)
        {
            var (index, statistic) = BestSplit(xs, lo, hi, minSegment);
            if (index < 0 || PValue(xs, lo, hi, minSegment, statistic, permutations, random) > alpha) return;
            double left = xs.Skip(lo).Take(index - lo).Average();
            double right = xs.Skip(index).Take(hi - index).Average();
            if (Math.Abs(right - left) / left < minRelativeChange) return;       // real but too small to act on
            found.Add(index);
            Segment(lo, index);
            Segment(index, hi);
        }
        Segment(0, xs.Length);
        found.Sort();
        return found;
    }
}

The checks cover a step, a step that is later fixed, a lone bad run, and a 3% shift. Then comes the comparison that matters: how often does each rule raise an alarm when nothing changed?

C#29 lines
var noise = new Random(8);
double[] Series(params (int Length, double Mean)[] levels) =>
    levels.SelectMany(l => Synthetic.Normal(noise, l.Length, l.Mean, sd: 2.0)).ToArray();

var step = Series((60, 100), (60, 106));                                  // a 6% regression at run 60
var found = ChangePoints.Detect(step, minSegment: 8, alpha: 0.01, permutations: 199, seed: 1, minRelativeChange: 0.02);
Debug.Assert(found.Count == 1 && found[0] == 60);

var revert = Series((40, 100), (40, 106), (40, 100));                     // a regression, then the fix
Debug.Assert(ChangePoints.Detect(revert, 8, 0.01, 199, 1, 0.02).SequenceEqual(new[] { 40, 80 }));

var spike = Series((120, 100));
spike[50] = 130;                                                           // one bad run is noise, not a change
Debug.Assert(ChangePoints.Detect(spike, 8, 0.01, 199, 1, 0.02).Count == 0);

Debug.Assert(ChangePoints.Detect(Series((60, 100), (60, 103)), 8, 0.01, 199, 1, 0.02).SequenceEqual(new[] { 60 }));   // 3% is visible

// Nothing changed and the noise is 3%: how often does each rule raise an alarm?
int detectorAlarms = 0, naiveAlarms = 0, trials = 200;
for (int trial = 0; trial < trials; trial++)
{
    var stable = Synthetic.Normal(noise, 120, 100, sd: 3.0);
    if (ChangePoints.Detect(stable, 8, 0.01, 199, seed: 1000 + trial, minRelativeChange: 0.02).Count > 0) detectorAlarms++;

    double baseline = stable.Skip(100).Take(5).Average();                  // the naive gate: the newest run against the last five
    if (stable[105] > baseline * 1.03) naiveAlarms++;
}
Debug.Assert(naiveAlarms > 0.15 * trials);                                 // about one build in five is flagged for nothing
Debug.Assert(detectorAlarms <= 0.03 * trials);                             // the change-point rule stays quiet

Two limits are worth saying out loud. First, sensitivity has a price: with 2% noise a 1% shift is invisible at 60 runs per side (the run-count formula agrees: about 64 are needed), so the platform reports the smallest detectable change per benchmark instead of pretending. Second, a change-point rule sees abrupt level shifts; a regression of 0.3% per release never trips it, which is the slow-creep problem in the follow-ups.

LLD

Deep dive: finding the commit

A change point says this batch. Batching saves hosts but leaves a range of commits (say 8). The bisect service narrows it: measure the midpoint build, decide good or bad with the same statistical rule, halve the range, repeat. The cost is log2(range) measurements, each of which is several interleaved runs, so 63 commits cost 6 measurements and 1,000 commits about 10. Two practical rules: confirm the final answer with a direct A/B between the culprit and its parent (a bisect can be fooled by noise or by an unrelated fix landing in the same range), and run bisects at lower priority than gating jobs so they do not starve them.

C# · Bisect, Pool23 lines
public static class Bisect
{
    /// <summary>The first slow commit in (lastGood, firstKnownBad], assuming every commit from the culprit on is slow.
    /// Returns it and how many builds had to be measured.</summary>
    public static (int Culprit, int Measurements) FirstBad(int lastGood, int firstKnownBad, Func<int, bool> isSlow)
    {
        int good = lastGood, bad = firstKnownBad, measured = 0;      // invariant: `good` is fast and `bad` is slow
        while (bad - good > 1)
        {
            int middle = good + (bad - good) / 2;
            measured++;
            if (isSlow(middle)) bad = middle; else good = middle;
        }
        return (bad, measured);
    }
}

public static class Pool
{
    /// <summary>Hosts needed for `runsPerDay` runs of `minutesPerRun` each: Little's Law with a target utilization.</summary>
    public static int MachinesNeeded(double runsPerDay, double minutesPerRun, double targetUtilization) =>
        (int)Math.Ceiling(runsPerDay * minutesPerRun / 1440 / targetUtilization);
}
C#
var (culprit, builds) = Bisect.FirstBad(lastGood: 100, firstKnownBad: 163, isSlow: commit => commit >= 141);
Debug.Assert(culprit == 141 && builds <= 6);                               // 63 commits narrowed to one in six measurements

Debug.Assert(Pool.MachinesNeeded(runsPerDay: 3880, minutesPerRun: 10, targetUtilization: 0.7) == 39);   // the estimate above

HLD

Deep dive: hardware, scheduling and cost

  • Pools by class. A job asks for a hardware class (bare metal A, cloud small, a test bed with a traffic generator), and the scheduler matches. One gating benchmark per host at a time: packing two jobs on a host destroys the isolation you paid for.
  • Bare metal against cloud. Bare metal is quieter, so it gates; cloud gives elasticity for scale tests and for work that tolerates noise. A hybrid is normal. If you must gate in the cloud, use dedicated hosts or large instances, interleave A and B on the same instance, and expect to need more repeats.
  • Size the pool with Little's Law, as in the estimate: arrival rate of runs times duration, divided by the utilization you can accept. Leave headroom for retries, bisects and host maintenance, and remember that a queue of jobs behind a saturated pool delays every result, which is the same hockey stick as any other service.
  • Security. The platform runs other people's code on expensive shared hosts. Image or clean hosts between jobs, deny network egress except to the artifact store, scope service accounts per team, and keep secrets out of benchmark containers.
  • Costs to cut first. Test selection by changed path, batching, fewer repeats on quiet benchmarks, shorter warm-ups once steady state is measured, and keeping raw profiles only for flagged runs.

HLD

Triage and trust

  • Route by ownership. Map benchmarks and changed paths to owning teams, deduplicate alerts that share a culprit, and attach everything the owner needs: the series with the change point marked, the interval, the effect size, the fingerprint, the culprit commit and a differential flame graph between the good and bad builds (see the profiling lesson). A ticket that explains why gets fixed; one that says "p99 +6%" gets argued with.
  • Close the loop. An owner can fix it, accept it as an intended trade-off (which resets the baseline and records the reason), or mark it a false alarm (which feeds the noise statistics). Improvements are tracked too, and a ratchet tightens a gate after a real gain so it cannot silently slip back.
  • Measure the platform itself: precision (confirmed regressions over alerts), time to detect, time to culprit, share of benchmarks that are gating versus noisy, and host calibration failures. If precision falls, people stop reading alerts, and the platform has failed whatever its uptime.

HLD

Failure modes and edge cases

CaseWhat goes wrongResponse
A host degrades mid-runA false regression on whatever ran thereCalibration before and after the job; mark invalid and re-queue
Fingerprint change (kernel, runtime, hardware refresh)The series steps for reasons unrelated to the codeAnnotate the series; re-baseline with an A/A run on the new fingerprint
Two regressions in one batchBisect finds the first and hides the secondAfter a fix, re-run detection on the same range
Offsetting changes (one faster, one slower)A net-zero shift hides two real changesTrack several metrics, and bisect on resource counters as well as latency
A benchmark grows its own data setA slow upward drift looks like a regressionPin data set versions; treat a data change as a new series
Noisy benchmark gates the merge queueDevelopers learn to ignore the platformGate only on stable benchmarks; show noise; reduce it or demote it
Pool saturatedResults arrive hours lateAlert on queue wait; shed low-priority jobs first; add hosts

Senior depth

What senior interviews ask about a performance testing platform

Interviewer follow-upL5How do you keep noisy benchmarks from blocking developers?How to answer

Measure each benchmark's own noise with A/A runs, publish it, and let only stable benchmarks gate. Noisy ones are trend-only until their owners fix the noise, and the platform shows the noise next to every result. Put the gate on a quiet metric (CPU or allocation per request) and keep tail latency as a guardrail with a looser threshold.

Interviewer follow-upL6How do you detect a 2% regression on a benchmark with 1% noise without alerting on noise?How to answer

Do not judge single runs. Take enough interleaved repeats to see the shift (about 16 × (σ ÷ δ)² per side, so 4 here), compare per-run values with an interval, require the interval to exclude zero and the effect to exceed a minimum, and watch the series over commits with a change-point rule so a sustained shift is separated from a bad run. Confirm on a fresh run before alerting, with the confirmation procedure fixed in advance so it is not "run until it looks bad".

Interviewer follow-upL6The change point shows up on a batch of eight commits. How do you find the culprit, and what does it cost?How to answer

Bisect inside the batch: measure the midpoint build, apply the same statistical decision, halve the range. Eight commits cost three measurements, 1,000 cost about ten, and each measurement is several repeats. Confirm with a direct A/B between the culprit and its parent, run bisects at low priority, and handle ranges where an unrelated fix hides the regression in the middle by checking the endpoints first.

Interviewer follow-upL6Bare metal or cloud for the gating tier?How to answer

Bare metal or dedicated hosts for gating, because noise decides sensitivity and a quiet host buys detectable changes. Use the cloud for scale-out tests and for noise-tolerant work. If cost forces cloud gating, use dedicated or large instances, interleave A and B on the same instance, increase repeats, and be explicit about the smallest detectable change.

Interviewer follow-upL7The product is a hardware appliance, tested with physical traffic generators on a lab test bed. What changes?How to answer

The scheduler allocates a topology rather than a host: a device under test, one or more traffic generators and a network path, reserved together for a whole job. Beds become the scarce resource, so queueing, priorities and preemption of low-value runs matter more. Each run needs a known device state (reset to a baseline configuration and software image), a hardware revision in the fingerprint, and calibration of the generators themselves (their maximum rate and accuracy, as in the load testing lesson). Tests are long (soak and capacity ramps), which increases the value of batching and of test selection. The analysis, change-point detection and bisect work unchanged; the runner abstraction is what differs. For network security devices there are published benchmarking methodologies to build the test definitions from.

Interviewer follow-upL7A service gets 0.3% slower with every release. No change point ever trips. How do you catch it?How to answer

Slow creep is invisible to rules that look for abrupt steps. Compare against fixed anchors as well as the recent past: the last release, the release a quarter ago, last year. Keep per-component budgets (CPU per request, allocation per request, binary size, startup time) with a ratchet that tightens when a gain lands, and track the same ratios in production telemetry, where traffic changes are visible. Review the trend on a schedule, and assign the budget to an owner so "everyone's 0.3%" becomes someone's responsibility.

Interviewer follow-upL7How do you connect lab results to what happens in production?How to answer

Treat the lab as an early, controlled detector of relative change, not as a source of absolute numbers. Build workloads from production statistics or replayed traffic, check that the lab's response to load matches production's with a calibration test, and validate with canary analysis against SLOs and continuous profiling diffs after deploys. When production and lab disagree, the disagreement is itself a finding about the workload model.

HLD

How to present this design in an interview

  1. Clarify: what is tested, what triggers a run, which metrics, who acts, what scale.
  2. Estimate: show that running everything on everything is impossible, and size the pool with Little's Law.
  3. Tier the tests by cost and noise, with test selection and batching.
  4. Draw the pipeline: trigger, scheduler, calibrated runners, separate load generators, raw and summary stores, analysis, bisect, triage.
  5. Go deep on trust: noise measurement and control, quiet metrics, per-run statistics, change-point detection, and the false-alarm rate you accept.
  6. Find the commit: batching plus bisect, with the cost in measurements.
  7. Close the loop: ownership, evidence in the ticket, baselines and ratchets, and metrics for the platform itself.
  8. Name the failure modes and the follow-ups: host drift, fingerprint changes, slow creep, hardware beds, lab versus production.

Summary

A performance platform is a pipeline whose value depends on its false-alarm rate. Tier the tests by cost and noise, select and batch to fit a realistic fleet, run on calibrated, pinned hosts with the load generator elsewhere, and store histograms and per-run summaries by commit order. Detect sustained level shifts with change-point detection, find the commit by bisecting the batch, and send the owner a ticket that explains the cause with a flame graph diff. Measure the platform by its precision, and plan for slow creep, fingerprint changes and the gap between lab and production.

Check yourself

Try answering out loud before you reveal each answer.

QuestionWhy can a platform not run every macro benchmark on every commit, and what do you do instead?Reveal answer

In the estimate it would take thousands of hosts (about 2,100) against 39 with batching and selection. Select only the benchmarks affected by the changed paths, test the head of a batch of commits, bisect inside the batch when something moves, and run the full suite nightly.

QuestionA rule flags a build when its newest run is 3% slower than the average of the last five. Noise is 3%. How often does it fire when nothing changed, and what is better?Reveal answer

About one build in five. Judge sustained shifts instead: compare per-run values with an interval and a minimum effect size, and run a change-point rule over the series in commit order, which stays quiet on a lone bad run and finds both a regression and its fix.

QuestionA change point lands on a batch of 63 commits. About how many measurements does the bisect need, and what do you do before filing the ticket?Reveal answer

About six (log base 2 of 63). Before filing, confirm with a direct A/B between the culprit commit and its parent, so noise or an unrelated change in the range cannot send the ticket to the wrong team.

Sources and further reading

  • David Daly, William Brown, Henrik Ingo, Jim O'Leary and David Bradford, The Use of Change Point Detection to Identify Software Performance Regressions in a Continuous Integration System (opens in a new tab), ICPE 2020: MongoDB's account of change-point detection on CI performance results. Later MongoDB papers name the E-Divisive means algorithm they use.
  • Matteson and James, "A Nonparametric Approach for Multiple Change Point Analysis of Multivariate Data", Journal of the American Statistical Association, 2014: the E-Divisive family.
  • Georges, Buytaert and Eeckhout, "Statistically Rigorous Java Performance Evaluation", OOPSLA 2007; and Mytkowicz and co-authors, "Producing Wrong Data Without Doing Anything Obviously Wrong!", ASPLOS 2009: variance and measurement bias.
  • Brendan Gregg, Systems Performance, 2nd edition, Addison-Wesley, 2020, for the host-level checks behind calibration.
Lesson 39 of 44

Nice. Lock it in, then keep going.

Up next · Lesson 40Case study: design a traffic inspection gatewayDesign an inline, firewall-style gateway that inspects traffic at line rate: packet budgets, per-core flow tables with symmetric hashing, fast and slow paths, kernel bypass, TLS cost, overload, and how to benchmark it, with tested C#.

Send a message

It goes straight to my inbox. I usually reply within a few days.