Pull request latency explained: an empirical overview

Xunhui Zhang, Yue Yu, Tao Wang, Ayushi Rastogi, Huaimin Wang

In the world of distributed software development, the "Pull Request" (PR) is the heartbeat of progress. But as any developer knows, that heartbeat can sometimes feel like a slow crawl. Why do some PRs get merged in minutes while others languish for weeks?

A recent paper, "Pull Request Latency Explained: An Empirical Overview," provides the most comprehensive look yet at the factors that drive PR latency. By analyzing over 3.3 million pull requests across 11,230 GitHub projects, the researchers have moved beyond simple "one-size-fits-all" explanations to show how the drivers of delay shift depending on the project's maturity, the team's size, and the stage of the review process.

TL;DR

PR latency isn't driven by a single factor; it’s a moving target. While the length of your PR description is the biggest predictor of delay at the moment of submission, once the review starts, the "first response time" from a reviewer becomes the dominant factor, explaining nearly 60% of the variance in latency.

What Problem Does This Paper Address?

The "pull-based" development model is inherently asynchronous. This leads to latency—the time between a PR being opened and it being closed (merged or rejected). High latency frustrates contributors, slows down feature delivery, and can lead to "abandonment" where developers simply give up on their contributions.

While previous studies identified individual factors (like PR size or developer reputation), they often lacked a systematic overview. This paper addresses two main gaps:

  1. Systematic Organization: Categorizing the dozens of factors that affect latency.
  2. Contextual Variation: Exploring how these factors change across different scenarios (e.g., projects using CI vs. those that don't) and contexts (e.g., small vs. large teams).

Methods

The researchers employed a multi-stage empirical approach:

  • Systematic Literature Review (SLR): They identified 45 distinct features from 17 previous studies known to influence PR latency.
  • Large-Scale Data Mining: They extracted data for these factors from over 3.3 million PRs using GHTorrent and the GitHub API.
  • Statistical Modeling: They used mixed-effects linear regression models. This is a sophisticated choice because it accounts for "random effects"—the inherent differences between individual projects—while measuring the "fixed effects" of the factors themselves.
  • Variance Analysis: To determine "importance," they used the percentage of explained variance (ANOVA type-II) as a proxy for how much a specific factor actually contributes to the total delay.

Datasets

The study utilizes a massive, diverse dataset:

  • Scope: 11,230 GitHub projects across 6 different programming languages.
  • Volume: 3,347,937 pull requests.
  • Features: 63 factors categorized into Developer Characteristics, Project Characteristics, and Pull Request Characteristics.

Key Insights and Ideas

  • The "Submission vs. Process" Shift: At the moment of submission, technical factors like the length of the PR description (46.3% variance) and the size of the code change (20.4%) are the primary drivers of expected latency. However, once the review process begins, social and process factors (like comments and response times) completely take over.
  • The Power of the First Response: For PRs that receive comments, the first response time of the reviewer is the single most critical factor, explaining 58.7% of the latency variance. If you want a fast merge, that first interaction is the bottleneck.
  • CI is a Double-Edged Sword: Interestingly, the study found that using Continuous Integration (CI) tools actually increases overall PR latency. While CI provides vital feedback, the time spent waiting for builds to finish and the complexity of fixing CI failures add measurable delays.
  • Maturity Matters: As projects evolve and mature, "Project Age" becomes a better predictor of latency. In mature projects, the review process becomes more standardized, making it easier to distinguish between fast and slow PRs based on project-level characteristics.

Key Results

The researchers broke down the "importance" (explained variance) of factors across different scenarios:

  • At Open Time: PR Description Length (46.3%) > Source Code Change Size (20.4%) > Contributor Experience (8.9%).
  • At Close Time: Presence of Comments (37.5%) > Whether the contributor is also an integrator (16.9%) > Description Length (12.3%).
  • With Comments: First Response Time (58.7%) > Number of Comments (31.4%).
  • Team Size Impact: In large teams (10+ members), the workload of the project (number of open PRs) distracts reviewers, significantly increasing the impact of code-level discussions on total latency.

Limitations and Future Work

The authors acknowledge several limitations:

  • Platform Bias: The study is limited to GitHub. Other platforms like GitLab or Bitbucket might exhibit different social dynamics.
  • Quantitative Focus: The study measures what is happening but doesn't interview developers to understand the why (e.g., why a reviewer chose to ignore a specific PR).
  • Missing Factors: Some factors, like "bug fix" labels, had too much missing data to be included reliably.

Future Work: The researchers suggest building specialized latency prediction tools that adapt based on the PR's current state (e.g., a different model for a PR that just failed a CI build vs. one that just received its first comment).

Summary updated

BibTeX
@inproceedings{zhang2022pull,
  author = {Xunhui Zhang and Yue Yu and Tao Wang and Ayushi Rastogi and Huaimin Wang},
  title = {{Pull request latency explained: an empirical overview}},
  booktitle = {Empir. Softw. Eng},
  year = {2022},
  url = {https://openreview.net/forum?id=ZrLXvTazUQc},
}
Figure