Only the bottleneck matters
The line runs at the speed of its slowest machine. Upgrading any other one changes your output by exactly zero — and the game will tell you when you have just spent money on nothing. Fix the slowest and the next one becomes the problem.