DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
  1. Home
  2. Articles
  3. Frontend Engineering
  4. Understanding the Browser Rendering Pipeline
XLinkedInReddit
MediumFrontend Engineering

Understanding the Browser Rendering Pipeline

D
DevPrep Team
February 10, 2026·1 min read·0
Table of Contents
  • The Critical Rendering Path
  • Layout (Reflow) vs Paint (Repaint)
  • The Worst Offenders
  • Compositing: The GPU Fast Lane
  • will-change: Use Wisely
  • Production Tips

Every pixel you see on screen goes through a precise pipeline. Understanding it is crucial for building performant UIs at Google-scale.

The Critical Rendering Path

  1. Parse HTML → DOM Tree
  2. Parse CSS → CSSOM Tree
  3. Combine → Render Tree (only visible elements)
  4. Layout → Calculate geometry (position, size)
  5. Paint → Fill in pixels (colors, borders, shadows)
  6. Composite → Layer composition on GPU

Layout (Reflow) vs Paint (Repaint)

Layout is triggered when geometry changes: width, height, position, font-size. It's expensive because it affects descendants.

Paint is triggered by visual changes that don't affect geometry: color, visibility, background-image.

The Worst Offenders

// Forces synchronous layout (layout thrashing)
elements.forEach(el => {
  el.style.width = container.offsetWidth + "px"; // Read then write in loop!
});

// Better: batch reads, then writes
const width = container.offsetWidth;
elements.forEach(el => {
  el.style.width = width + "px";
});

Compositing: The GPU Fast Lane

Properties like transform and opacity skip layout and paint entirely — they go straight to the compositor thread on the GPU.

/* Bad - triggers layout */
.animate { left: 100px; }

/* Good - compositor only */
.animate { transform: translateX(100px); }

will-change: Use Wisely

will-change promotes an element to its own compositor layer. But each layer costs GPU memory. At Google, we only use it for elements that will actually animate.

Production Tips

  • Use Chrome DevTools Performance tab to identify layout thrashing
  • Avoid reading layout properties inside animation frames
  • Prefer requestAnimationFrame over setTimeout for visual updates
  • Use contain: layout to limit reflow scope

Related Articles

MediumFrontend Engineering

System Design #12: Design a Multi-Step Form Wizard

7 min read
MediumFrontend Engineering

Mastering Senior-Level JavaScript Interview Concepts

2 min read
MediumFrontend Engineering

System Design #9: Design a Collaborative Text Editor

9 min read

Comments (0)

Sign in to leave a comment.

No comments yet. Be the first to comment.

Table of Contents

  • The Critical Rendering Path
  • Layout (Reflow) vs Paint (Repaint)
  • The Worst Offenders
  • Compositing: The GPU Fast Lane
  • will-change: Use Wisely
  • Production Tips

Series

View all Frontend Engineering articles →

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.