How Pinpoint Finds Chromium Performance Regressions
This article explains the Pinpoint bisect service, an automated diagnostic tool used by the Chromium project to maintain web browser speed and efficiency. It covers what the Pinpoint service is, how it integrates with Chromium's continuous integration infrastructure, and the step-by-step binary search and statistical methods it uses to automatically isolate the exact code commit responsible for a performance regression.
What is the Pinpoint Bisect Service?
Pinpoint is a microservice developed by the Chrome Operations team to automate the process of tracking down performance regressions and improvements in the Chromium codebase. Hundreds of commits land in the Chromium repository every day. Because running comprehensive performance benchmarks takes hours, Chromium cannot test every single commit in real time. Instead, benchmarks are run periodically, meaning a detected performance regression could be caused by any one of dozens or hundreds of commits that landed between two test runs.
Pinpoint solves this problem by automatically performing a "bisect"—a systematic search through the commit history—to find the exact change (culprit) that altered the browser's performance, without requiring human intervention.
How Pinpoint Isolates the Exact Commit
When the Chromium performance dashboard detects a significant degradation in a metric (such as page load time, memory usage, or frame rate), it automatically files a bug and triggers a Pinpoint job. Pinpoint then executes the following workflow to find the culprit.
1. Defining the Commit Range
Pinpoint starts with two known points: the "last known good" commit (before the regression occurred) and the "first known bad" commit (where the regression was first detected). This establishes the search range.
2. Binary Search (Bisection)
Testing every commit in the range sequentially would take too much time and computing power. Instead, Pinpoint uses a binary search algorithm. It selects the commit exactly in the middle of the "good" and "bad" range.
If the range is 100 commits, Pinpoint tests Commit 50.
- If Commit 50 shows the normal performance, the regression must have happened after it (between Commit 50 and 100).
- If Commit 50 shows the degraded performance, the regression must have happened before it (between Commit 1 and 50).
By repeating this process, Pinpoint cuts the search space in half with every step, reducing 100 commits to a single culprit in just about seven steps.
3. Automated Building and Swarming Execution
For each commit it needs to test, Pinpoint coordinates with Chromium's build infrastructure. It requests a freshly compiled binary of the Chromium browser at that exact revision. Once built, Pinpoint sends the binary to "Swarming," Chromium's distributed test lab. The test is executed on the exact same physical hardware configuration (such as a specific Android phone, MacBook, or Windows desktop) where the original regression was detected. This ensures environment consistency.
4. Statistical Analysis to Handle Noise
Unlike functional bugs, which either pass or fail, performance metrics are inherently noisy. Running the same benchmark twice on the exact same build will yield slightly different numbers due to CPU temperature, background OS tasks, and network variance.
To prevent false positives, Pinpoint does not rely on a single test run. It runs the benchmark multiple times for each commit and collects a distribution of results. It then uses statistical hypothesis testing—specifically the Mann-Whitney U test and the Kolmogorov-Smirnov test—to compare the midpoint commit's results against the known "good" and "bad" distributions.
- High Confidence: If the statistical p-value confirms the results are significantly different, Pinpoint confidently narrows the search range.
- Low Confidence: If the difference is lost in the noise, Pinpoint automatically schedules more benchmark runs on that commit to gather more data until statistical significance is achieved.
5. Drilling into Dependency Rolls (DEPS)
Chromium relies on massive external sub-repositories, such as the V8 JavaScript engine, the Skia graphics library, and WebRTC. Changes to these projects are brought into Chromium via "DEPS rolls"—single commits that update Chromium to use a newer version of the sub-repository, often containing dozens of individual changes.
If Pinpoint isolates a DEPS roll as the culprit, its job is not finished. Pinpoint automatically reads the dependency file, opens the sub-repository's commit history, and continues the binary search inside that third-party repository. This allows it to find the exact V8 or Skia commit that slowed down the browser.
6. Culprit Reporting and Action
Once the binary search narrows the range down to a single commit where the performance distribution clearly shifts from "good" to "bad," Pinpoint concludes the job. It automatically posts a detailed report to the issue tracker, graphs the performance shift, and assigns the bug directly to the engineer who authored the commit. In many clear-cut cases, the system can even automatically generate a revert of the offending commit to keep the browser fast while the developer investigates the issue.