Skip to content

Instantly share code, notes, and snippets.

@reidjs
Last active April 28, 2022 01:10
Show Gist options
  • Select an option

  • Save reidjs/4355dd58619ab4f2b26f2492ff73c08e to your computer and use it in GitHub Desktop.

Select an option

Save reidjs/4355dd58619ab4f2b26f2492ff73c08e to your computer and use it in GitHub Desktop.
Keep Your Pull Requests Small, Explained Mathematically
It takes exponentially longer for a developer to review pull requests as they become more complex,
this is a simple model of the relationship:
t = k**n
t: time to complete code review
k: the number of files
n: the number of changes per file
This model demonstrates that smaller PRs are much faster to review. For example:
If you need to change 10 files and an average of 4 changes per file,
it will take 10**4 or 10,000 developer-time units to review the PR
If you can split that in half to 5 files, with an average of 4 changes per file,
it will take (5**4 + 5**4) or 1,250 developer-time units to review the PR
By splitting the PR in half, the time it takes to review it drops by nearly an order of magnitude (8x).
@saintx
Copy link
Copy Markdown

saintx commented Apr 28, 2022

Couldn't agree more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment