DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • How the Web Works
  • Browsers: The Engines
  • Networking & Latency
  • HTTPS & TLS Handshake
  • CDNs & Edge Computing
  • WebSockets & WebRTC
  • RESTful Architecture
  • GraphQL Architecture
  • CORS (Cross-Origin Resource Sharing)
  • Load Balancing
  • Critical Rendering Path Deep Dive
  • DOM vs. CSSOM Construction
  • The Rendering Engine: Layout, Paint, Compositing
  • JavaScript Engine: V8 Internals
  • The Event Loop: Macro vs. Micro Tasks
  • Garbage Collection
  • Browser Storage Architecture
  • Service Workers & PWAs
  • Web Workers: Multi-Threading
← From Beginner to Expert in Fundamentals of Frontend

Critical Rendering Path Deep Dive

25 min read
CRPDOM ConstructionCSSOMRender TreeLayoutPaintCompositing

The Critical Rendering Path: From Bytes to Pixels

The CRP is the sequence of steps the browser takes to convert HTML, CSS, and JavaScript into pixels on screen.

The 6 Steps

  1. Build the DOM: Parse HTML into a tree of nodes
  2. Build the CSSOM: Parse CSS into a style tree
  3. Build the Render Tree: Combine DOM + CSSOM (excludes display:none)
  4. Layout (Reflow): Calculate exact size and position of every element
  5. Paint: Fill in pixels — colors, borders, shadows, text
  6. Compositing: Combine painted layers in correct order

Render-Blocking Resources

CSS is render-blocking by default. JavaScript is parser-blocking. Solutions:

  • defer: Download in parallel, execute after HTML parsing
  • async: Download in parallel, execute immediately (order not guaranteed)

Layout vs Paint vs Composite

Reflow (Expensive)Repaint (Moderate)Composite Only (Cheap)
width, height, margincolor, backgroundtransform
display, positionbox-shadowopacity

Animations using transform and opacity are GPU-accelerated and skip Layout and Paint — this is why translateX is 60fps but left causes jank.

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.