Chapter 0

The Rendering Pipeline & Frame Budget

Why transform/opacity stay smooth and width/left stutter.

DevToolswill-changerequestAnimationFrame
Style → Layout → Paint → Composite. The compositor thread keeps animations smooth even when the main thread is blocked — if you only animate compositor-friendly properties.

Before any library, before any easing curve, there is the browser's rendering pipeline. Every visual change your animation makes flows through up to four stages — and which stage it touches decides whether you get butter-smooth 120fps or a stuttering mess.

The pipeline: Style → Layout → Paint → Composite

On each frame the browser may run these stages in order. The trick of high-performance motion is to change only properties that skip straight to the last one.

1
Style
2
Layout
3
Paint
4
Composite

See it: layout-bound vs compositor-bound

Both boxes travel the same distance. The red one animates left (layout every frame); the teal one animates transform: translateX (composite only). Now hit “block the main thread” and watch only the red one freeze.

Main-thread block test live demo
left
transform
60fps
dropped: 0

The teal (compositor) box keeps gliding; the red (layout) box and the FPS meter both stall.

The performance tier list

Memorize this. It is 80% of practical animation performance.

Composite
transform, opacity cheap
Paint
color, box-shadow, background medium
Layout
width, height, top, left, margin expensive

Playground: classify the property

Edit the keyframes below. Swap transform for left/width and you’ll feel the difference under load — this is the same demo, yours to break.