Skip to content
Marvex

Platform engineering

Batch Size Is the Variable Underneath Every Delivery Metric

When a delivery problem has no obvious cause, measure how big the changes are and how long the branches live. It is usually one of those two.

How batch size — expressed as branch lifetime and pull request size — propagates into review latency, rework rounds, change failure rate and recovery time, and what trunk-based development changes about each.

Platform EngineeringMarvex EngineeringEngineering Intelligence, Shiprocket9 min read
Streams of code rendered on a dark screen, suggesting a version control history

One variable, four symptoms

Batch size is the amount of change that travels together — practically, the size of a pull request and the lifetime of the branch it sits on. It is the least discussed variable in delivery and the one that explains the most, because it propagates into every metric downstream and does so non-linearly.

Review is the first casualty. Reviewing a change is a cognitive task with a hard ceiling; past a certain diff size the reviewer cannot hold the change in their head, and what happens next is not slower review but shallower review. The comments become stylistic because the structural questions are no longer answerable. A very large pull request that is approved quickly has not been reviewed, it has been waved through, and the review-depth signal on it will be conspicuously low relative to its size.

Rework is the second. A large change encodes many decisions, so it offers many opportunities to disagree, and disagreements discovered at review time are expensive because the code already exists. This is where multi-round rework loops come from.

Change failure rate is the third: more independent changes shipping together means more chances one of them is wrong, and no way to isolate which. Recovery time is the fourth, for the same reason from the other side — rolling back a large batch reverts work that was fine, and bisecting a large batch is slow while the service is degraded.

  • Oversized reviews get shallower, not slower
  • Large changes generate more late-discovered disagreement, which is rework
  • Failure rate rises with the number of independent changes in a release
  • Recovery slows because diagnosis and rollback both scale with the batch

What trunk-based development actually asks of you

Trunk-based development means everyone integrates into a single shared branch frequently — branches measured in hours or a day or two, not weeks. It is the practice the DORA research programme has repeatedly associated with high delivery performance, and it is regularly misread as an instruction to abandon code review or push to main untested. It is neither. Short-lived branches with review still qualify; the constraint is on branch lifetime, not on process.

The reason lifetime matters is divergence. A branch that lives for three weeks is being written against a trunk that has moved on, and the cost of reconciling it grows with the square of nothing in particular but certainly faster than linearly. That reconciliation surfaces as merge conflicts, as rework, and as the class of bug where two changes were each correct in isolation.

The real prerequisite is a way to merge incomplete work safely. Without feature flags, branch by abstraction, or a similar technique, a developer with a five-day feature has no honest way to integrate on day one, and telling them to merge daily is asking them to ship a half-built thing. Teams that adopt trunk-based development without giving people that mechanism first get exactly the pushback they deserve.

The second prerequisite is a fast, trustworthy CI pipeline, because frequent integration multiplies the number of pipeline runs. If the suite takes an hour and is flaky, integrating daily is punishing and people will stop.

  • The constraint is branch lifetime, not the removal of review
  • Feature flags or branch by abstraction are a prerequisite, not an add-on
  • Frequent integration multiplies CI runs, so pipeline speed becomes load-bearing

How to split work that does not want to be split

The standard objection is that some changes are genuinely indivisible. Occasionally true, usually not. Most large pull requests are large because they bundle several separable kinds of work, and separating them is mechanical once you know what to look for.

Pull the pure refactors out first and ship them on their own. A rename, an extraction, a move — these are individually reviewable at a glance and they are the bulk of the diff in a large change. Shipping them separately shrinks the remaining pull request to the part that actually needs thought, which is where review attention belongs.

Ship the data-shape change before the behaviour that needs it. A new column, a new field, a new interface with no callers is safe, boring and reviewable. The behaviour change that follows is then small and focused.

Put the new path behind a flag and merge it dark. The code lands, nothing changes for users, and the reviewer sees a contained addition rather than a rewrite. This also decouples merging from releasing, which is what allows batch size and deployment risk to be managed independently.

Finally, watch for the pull request that grew by accident. Many oversized changes are one intentional change plus opportunistic cleanup along the way. The cleanup is valuable; it just belongs in its own change, where somebody can actually see it.

  • Ship pure refactors separately — they are most of the diff and cost nothing to review
  • Land schema and interface changes before the behaviour that uses them
  • Merge behind a flag so merging is decoupled from releasing
  • Split off opportunistic cleanup rather than smuggling it in

Measuring batch size rather than guessing at it

Batch size is measurable directly, which is unusual for something this influential. Pull request size — lines changed, files touched — is available from source control on every change, and Marvex reports it alongside cycle time and review depth. The useful reading is the distribution: a median that is reasonable with a long tail of very large changes is a different problem from a uniformly large median.

Read size against the four cycle-time stages, because the pairing is diagnostic. Large changes with long review time are the expected, honest case: the reviewer is doing real work on a change that asks a lot. Large changes with short review time are the worrying case, because that combination means the review was not deep. Small changes with long pickup time point at ownership and routing rather than at size at all.

Rework rounds are the other signal to pair with size. Large change plus repeated rework almost always means the approach was not agreed before the code was written, and no review-process change will fix it — the intervention belongs earlier, in a short design conversation.

Branch lifetime is worth tracking as its own number. Pull request size measures the change; branch age measures how long it diverged. They usually correlate but not always, and a team with small pull requests sitting on long-lived branches has the integration problem without the review problem.

  • Read the distribution of PR size, not the average
  • Large size plus fast review means shallow review, not efficient review
  • Large size plus repeated rework means missing upstream alignment
  • Track branch lifetime separately from change size

Sequencing a change to how a team works

Do not open with a size limit. A rule capping pull requests at some number of lines, imposed before the enabling mechanisms exist, produces artificially split changes that are individually meaningless and collectively harder to review — and it inflates deployment counts while improving nothing.

Start with the mechanism: get feature flags or an equivalent in place, and make the CI pipeline fast and non-flaky enough that integrating several times a day is comfortable. Those two investments remove the legitimate reasons a change stays big.

Then make size visible without making it a target. Showing pull request size next to review depth and rework rounds in a weekly team review is usually enough; engineers do not need to be told that a two-thousand-line change is hard to review, they need the trade-off to be discussable.

Expect the metrics to move in a specific order. Review latency and rework improve first, because they respond directly to smaller changes. Deployment frequency follows once the merge cadence rises. Change failure rate and recovery time move last and most subtly, because they depend on the batch reaching production in smaller pieces, which also depends on your release mechanics rather than on branch discipline alone.

  • Mechanisms before rules: flags and fast CI, then talk about size
  • Make size visible next to review depth and rework, not as a cap
  • Expect review latency and rework to improve before stability metrics do
trunk-based developmentbatch sizecode reviewcontinuous integration

Frequently asked questions

What is trunk-based development?

Trunk-based development is a source control practice in which everyone integrates their work into a single shared branch frequently — branches live hours or a day or two rather than weeks. It does not mean abandoning code review or pushing untested code to main; short-lived branches with pull requests and review qualify. The constraint is on how long a change diverges from trunk, because divergence is what produces merge conflicts, late-discovered disagreement and the class of bug where two changes were each correct in isolation.

Why does a large pull request get worse reviews rather than slower ones?

Because reviewing is a cognitive task with a practical ceiling. Past a certain diff size the reviewer can no longer hold the whole change in their head, so the structural questions — is this the right decomposition, does this interface make sense, what happens on failure — stop being answerable and the comments drift to naming and style. A large pull request approved quickly has usually been waved through rather than reviewed, and that pattern is visible when review depth is unusually low relative to change size.

How does batch size affect change failure rate and recovery time?

Both get worse as batches grow, for related reasons. A release containing many independent changes has more chances that one of them is defective, and no way to isolate which one from the failure alone. When something does go wrong, rolling back the batch reverts work that was fine, and bisecting through it takes time while the service is degraded. Smaller releases give a smaller suspect list, which shortens diagnosis, and a cheaper rollback, which shortens recovery.

How do you split a change that seems indivisible?

Most large changes bundle separable kinds of work. Extract pure refactors — renames, moves, extractions — and ship them on their own, since they are usually most of the diff and are reviewable at a glance. Land schema, field and interface additions before the behaviour that consumes them, because an unused addition is safe and small. Merge the new path behind a feature flag so it lands dark. And split out opportunistic cleanup that attached itself to the change along the way.

Should we set a maximum pull request size?

Not as an opening move. A hard cap imposed before feature flags and a fast CI pipeline exist produces artificially fragmented changes that are individually meaningless and collectively harder to review, and it inflates deployment counts without improving delivery. Put the enabling mechanisms in place first, then make size visible next to review depth and rework rounds so the trade-off is discussable. Engineers generally know a two-thousand-line change is hard to review; what they need is a way to avoid producing one.

Which metrics improve first when batch size falls?

Review latency and rework rounds move first, because they respond directly to changes being smaller and easier to reason about. Deployment frequency follows as merge cadence rises. Change failure rate and failed deployment recovery time move last and most subtly, because they depend on smaller batches actually reaching production separately, which is governed by release mechanics — trains, windows, promotion steps — as much as by branch discipline.

Marvex

See it on your own delivery data

Connect GitHub, GitLab or Jira and Marvex builds your DORA, cycle-time and sprint views from the history you already have.