Skip to Content
MetricsPull Request Size

Pull Request Size

WHY IT MATTERS

Agile development has proven that teams perform better when they deliver working software frequently. Small, manageable pull requests are more easily reviewed, tested, deployed, and maintained — giving rise to higher development velocity and better overall performance.

HOW IT’S MEASURED

Pull request size is calculated as the average number of lines of code changed per pull request, excluding manifest files, such as package.json.

CHOOSING BETWEEN AVERAGE AND P75

Both the average (mean) and the p75 (75th percentile) are useful metrics for pull request size, but they serve different purposes. Understanding when to use each one helps you make better decisions about your development workflow.

When to use p75:

Use the p75 when you want to optimize your team’s day-to-day workflow and identify review bottlenecks. The p75 tells you that “75% of our PRs are smaller than X lines of code,” which represents the upper bound of your standard workflow. This metric is particularly valuable for:

  • Setting team benchmarks: If your p75 is high, it means a significant portion of your team’s regular work is too large to be reviewed efficiently.
  • Identifying bottlenecks: Review time scales exponentially with PR size—a 1,000-line PR takes significantly longer to review than ten 100-line PRs. The p75 exposes the tail end of the distribution, highlighting the PRs most likely causing delays in your code review phase.
  • Minimizing outlier impact: In software development, most PRs are small (quick bug fixes, minor updates), but a few are massive (refactors, dependency updates, initial commits). The p75 remains stable even when these large PRs occur, giving you a clearer picture of typical team behavior.

When to use average:

Use the average when you need to understand the total volume of code changes or aggregate team output. The average is particularly valuable for:

  • Calculating total throughput: Understanding the overall volume of code being produced across your entire workflow.
  • Resource planning: Estimating review capacity needs based on total code volume.
  • Detecting shifts in work patterns: If the average increases significantly while the p75 stays stable, it indicates an increase in large PRs (such as dependency updates or major refactors) that may require special handling.

RELATED ARTICLES

Last updated on