Estimate time savings from running pipeline stages in parallel versus sequentially.
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.
totalTime = sequentialStagesTotal + max(branch1, branch2, branch3)
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.
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.
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.