← Lessons

quiz vs the machine

Platinum1780

System Design

Critical Path Analysis

Finding the chain of spans that actually determines how long a request takes.

5 min read · advanced · beat Platinum to climb

Not All Time Counts

A trace may contain dozens of spans, but only some of them control the total duration. The critical path is the chain of spans that, if shortened, would make the whole request faster. Time spent in parallel work that finishes early does not count.

Sequential vs Parallel

  • Sequential spans add up; each must finish before the next starts.
  • Parallel spans overlap; only the longest one is on the critical path.

If a request fires three calls at once and waits for all, only the slowest contributes to latency. Optimizing the other two changes nothing.

In this trace the path through the slow fetch dominates, so the fast fetch is off the critical path.

Why It Guides Optimization

Without critical path analysis, teams optimize whatever looks big rather than what controls latency. The analysis tells you exactly which spans to attack and which are already free, preventing wasted effort on parallel work that overlaps with something slower.

Key idea

Critical path analysis identifies the chain of spans that determines total latency, so parallel work hidden behind a slower span is correctly ignored.

Check yourself

Answer to earn rating on the learn ladder.

1. When three calls run in parallel, which is on the critical path?

2. Why is critical path analysis useful for optimization?