Parallel Stage Time Calculator
Calculate total pipeline time combining sequential stages with a parallel stage group, where the group's time is its slowest branch.
Inputs
Combined time of all stages that run one after another (outside the parallel block).
Duration of the first branch inside the `parallel {}` block.
Duration of the second branch inside the `parallel {}` block.
Duration of the third branch inside the `parallel {}` block.
Total Pipeline Time
190.0sec
Parallel Group Time (Critical Path)
100.0sec
Time Saved vs. Fully Sequential
105.0sec
Step by step
Parallel group time = slowest branch
max(60s, 100s, 45s)
= 100.0s
Total = sequential + parallel group
90s + 100.0s
= 190.0s
How it works
In a Jenkins declarative pipeline, stages inside a `parallel {}` block start together and the block doesn't complete until its slowest branch finishes — so the group contributes only its maximum branch duration to the critical path, not the sum of all branches. Total pipeline time is therefore the sum of sequential stage time plus that single slowest-branch duration, which is why balancing parallel branches to similar durations (rather than having one long outlier) yields the biggest time savings.
Formula
totalTime = sequentialStagesTotal + max(branch1, branch2, branch3)
- S
- Sequential stages total time in seconds
- P_1
- Parallel branch 1 duration in seconds
- P_2
- Parallel branch 2 duration in seconds
- P_3
- Parallel branch 3 duration in seconds
- T
- Total pipeline time in seconds
Frequently Asked Questions
What if one parallel branch is much slower than the others?
The whole parallel block still waits for that slowest branch, so the faster branches' executors sit idle after finishing — rebalancing work more evenly across branches (or giving the slow branch more resources) reduces the group's critical-path time.
Does adding more parallel branches always help?
Only if it reduces the slowest branch's duration; adding branches for unrelated work that doesn't shorten the critical path (or that saturates available executors, causing branches to queue rather than truly run concurrently) won't reduce total time.
Can parallel blocks be nested with more sequential stages?
Yes — pipelines commonly alternate sequential and parallel blocks; for multi-block pipelines, apply this same sum-of-sequential-plus-max-of-parallel logic to each block in turn along the overall stage sequence.