Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 6

Evaluating Practical Significance in Regression

Recommended resources

Hello! In our last lesson, we focused on how to isolate clean, representative data by separating a load test into its warm-up, steady-state, and cool-down phases. This ensures the numbers we analyze reflect the system's true behavior under sustained load.

Now, we'll address the next critical question. Imagine you've run two tests: one for your baseline build and one for a new candidate build. Your Grafana dashboard shows the median (p50) response time increased from 150ms to 165ms. Is this 15ms increase a genuine performance regression that should block a release, or is it just random statistical noise? This lesson will equip you to answer that question with confidence. We'll move beyond simple comparisons and learn how to use median differences, data dispersion, and confidence intervals to determine if an observed change is practically meaningful.

Why Simple Comparisons Are Misleading

A single metric like the median is a point estimate—one number trying to represent thousands or millions of measurements. It's useful, but it hides the full story of the data's distribution and variability. A 15ms change in the median can mean very different things depending on the dispersion (or spread) of the results in each test.

Consider two scenarios, both with a 15ms median increase:

  1. High Variability: Both the baseline and candidate tests show a wide spread of response times. The distributions of the two tests overlap significantly. In this case, the 15ms difference might just be random chance—a product of the inherent noise in the system.
  2. Low Variability: Both tests produce very consistent results with a narrow spread of response times. The distributions are tight and barely overlap. Here, that same 15ms difference is much more likely to be a real, repeatable effect of the code change.

To make a sound judgment, we need to account for this variability. But first, let's clarify two crucial and often confused concepts: statistical significance and practical significance.


Statistical vs. Practical Significance

In performance engineering, not all measurable differences are meaningful. A change might be "statistically significant," meaning it's very unlikely to be due to random chance, but still be too small to have any real-world impact. This is the concept of "practical significance."

The following article from "Statistics By Jim" provides an excellent explanation of this distinction. As you read, focus on how sample size can create statistically significant results for tiny, unimportant effects.

Practical vs. Statistical Significance - Statistics By Jim

This article clearly separates the mathematical definition of a "significant" effect from the real-world importance of that effect. This is a core concept for making defensible performance recommendations.

Please read the first two main sections of the article. Start with Statistical Significance, and continue through Practical Significance. Pay close attention to the example of the training program where a 3-point average improvement was statistically significant but not practically meaningful.

As the article makes clear, your subject-area expertise is required to define what is practically significant. For your system, is a 10ms regression acceptable? 50ms? Does it depend on the endpoint? This threshold is your benchmark for practical importance, often informed by Service Level Objectives (SLOs). A change might be statistically real, but if it's well within your SLO, it may not be worth blocking a release over.


Quantifying Uncertainty with Confidence Intervals

So, how do we account for the sample variability we discussed earlier? We use confidence intervals (CIs). Instead of a single point estimate (e.g., "the median is 165ms"), a confidence interval gives us a range of plausible values for the true median (e.g., "we are 95% confident the true median is between 161ms and 169ms"). This range is calculated from your sample data and incorporates its variability.

This short video gives a great conceptual introduction to what confidence intervals are and how they're used.

Introduction to Confidence Intervals

This video from jbstatistics explains the core idea of a CI as a range of plausible values for a population parameter, estimated from a sample.

Watch from the beginning until the main example is complete. Focus on these key ideas: A CI gives a range of plausible values for a parameter (like the true population mean/median), not a statistic. The confidence level (e.g., 95%) reflects our confidence that the range contains the true parameter. A CI is built from a point estimate (like the sample mean) plus or minus a margin of error, which accounts for sampling variability.

The key takeaway is that the CI provides a more honest representation of our measurement. It acknowledges that our test run is just one sample, and the "true" performance characteristic lies within a range. The width of this range tells you how much uncertainty there is: a narrow CI means high precision, while a wide CI indicates high variability in your measurements.


Comparing Two Samples Using Confidence Intervals

Now we can apply this tool to our problem of comparing a baseline and a candidate build. By calculating a confidence interval for the median of each test, we can perform a quick visual statistical test.

This video from StatQuest provides a brilliantly clear visual explanation of how to do this.

Confidence Intervals, Clearly Explained!!!

This video directly demonstrates the technique of comparing CIs from two different samples to check for a significant difference.

Please watch the segment from comparing two samples. The key rule to remember is explained here.

As you saw, the rule is simple and powerful:

  • If the 95% confidence intervals of the two samples do not overlap, the difference between them is statistically significant.
  • If they do overlap, the result is inconclusive; the difference may not be statistically significant.

Let's look at what this looks like on a typical plot you might generate.

This interval plot compares two groups. The dot represents the sample mean (or median), and the vertical bars represent the 83% confidence interval for that mean. In this case, because the intervals do not overlap, we can conclude there is a statistically significant difference between the means of Strength A and Strength B.

This visual check is your first step in rigorous analysis.


Putting It All Together: A Workflow for Regression Analysis

Let's consolidate these ideas into a practical workflow you can use on the job.

  1. Define Practical Significance: Before you test, determine the smallest performance change that matters. For example, "any regression greater than 20ms or 5% of the median response time is practically significant." This often comes from your SLOs.

  2. Run and Measure: Execute your load tests for the baseline and candidate builds, ensuring you analyze only the steady-state data.

  3. Calculate Medians and CIs: For each test run, calculate the median response time and its 95% confidence interval. Most statistical packages or libraries (like Python's scipy and numpy) can do this.

    • A quick note: Because performance data is often heavily skewed (think of the long tail of p99 latencies), the median is a more robust measure of central tendency than the mean. The academic paper below discusses why this is the case.
  4. Check for Statistical Significance: Plot the two medians and their CIs, just like in the interval plot above. Do they overlap?

    • No Overlap: The regression is statistically significant. Proceed to the next step.
    • Overlap: You cannot conclude there is a significant difference. The change is likely just noise. You can stop here.
  5. Check for Practical Significance: If the result was statistically significant, now compare the magnitude of the change to your predefined threshold.

    • Look at the gap between the intervals. For a regression, the most pessimistic (and safest) estimate of the difference is the difference between the bottom of the candidate's CI and the top of the baseline's CI.
    • Is this difference greater than your practical significance threshold?
      • Yes: You have strong evidence of a real, meaningful performance regression. Time to raise a flag and investigate.
      • No: You have found a statistically real effect, but its magnitude is too small to be concerned about. You can likely approve the change.

This structured process provides a defensible, evidence-based foundation for your performance recommendations, which is a hallmark of a senior engineer.

For a deeper dive into the statistical reasoning, especially regarding the use of the median for performance data, the following research paper provides a formal perspective.

Automated Performance Deviation Detection Across ...

This paper details an automated approach for finding performance regressions, relying heavily on the statistical methods we've just discussed. Reading a few key paragraphs will ground your practical knowledge in formal theory.

This is a dense document, so focus only on these specific parts: In section "C. Compute Interval Estimation," read the discussion on why performance data is often not normally distributed and why the median is a more robust estimator. Find the paragraph that starts with this sentence. In section "D. Detect Deviations," read the two bullet points that formally define the criteria for a statistically significant difference based on CIs. In the final "Discussion" section, read the short paragraph that reinforces our earlier point about the difference between statistical and practical significance.


Conclusion

You are now equipped to move beyond simple "eyeball" comparisons of performance metrics. By embracing a bit of statistical rigor, you can make far more reliable and defensible decisions about whether a performance change is real and whether it matters.

Key Takeaways:

  • Comparing single-point estimates like the median is unreliable because it ignores data variability.
  • Statistical significance indicates an effect is likely real (not random chance), while practical significance asks if the effect is large enough to care about.
  • Confidence intervals (CIs) provide a range of plausible values for a metric, accounting for measurement uncertainty.
  • A powerful visual test for statistical significance is to check for overlap between 95% confidence intervals. No overlap implies a significant difference.
  • A complete analysis involves checking for both statistical significance (using CIs) and practical significance (using your domain expertise and SLOs).

In this lesson, we've learned how to properly interpret measurement data. However, this assumes the data itself is correct. In our next lesson, we will investigate a subtle but critical measurement problem known as coordinated omission, which can cause your tools to lie to you by systematically ignoring the slowest requests, making your system appear much faster than it really is.