"매 HTML/CSS/JS 의 화면 픽셀로 도달하는 순차적 stage chain". 매 Parse → Style → Layout → Paint → Composite 의 5단계 — 매 stage 의 cost 의 understand 의 LCP/INP/CLS 의 optimize 의 critical path.
매 핵심
매 5 stages
Parse: HTML → DOM, CSS → CSSOM (parallel, but CSS blocks render).
Style: DOM + CSSOM → Render Tree (visible nodes only — display:none excluded).
Layout (Reflow): geometry 계산 — x/y/width/height.
Paint: pixel 채우기 — color, image, shadow, text.
Composite: layer 합성 — GPU 의 transform/opacity 의 처리.
매 blocking resources
CSS: render-blocking — CSSOM 의 완성 의 wait.
JS (sync): parser-blocking — DOM 의 build 의 pause.
JS (async): 매 download parallel, execute when ready (parser pause).
JS (defer): 매 download parallel, execute after DOMContentLoaded.
<head><style>/* above-the-fold CSS only — 14KB 이내 */body{margin:0;font-family:system-ui;}.hero{height:100vh;background:#000;}</style><linkrel="preload"href="/main.css"as="style"onload="this.onload=null;this.rel='stylesheet'"></head>
Composite-only animation (cheap)
/* O — composite layer 만 — 60fps 안정 */.card{transition:transform200ms,opacity200ms;}.card:hover{transform:translateY(-4px);opacity:0.9;}/* X — layout + paint trigger — jank */.bad{transition:top200ms,height200ms;}
Reflow 의 batch (read-then-write)
// X — interleave read/write — forced reflow per write
elements.forEach(el=>{constw=el.offsetWidth;// read (force layout)
el.style.width=(w*2)+'px';// write (invalidate)
});// O — batch read, then batch write
constwidths=elements.map(el=>el.offsetWidth);elements.forEach((el,i)=>el.style.width=(widths[i]*2)+'px');
언제: Web Vitals regression 의 분석, layout thrash 의 detect, optimization 의 prioritize.
언제 X: Real User Monitoring (RUM) 의 raw data 의 aggregate (specialized tooling 의 use).
❌ 안티패턴
모든 element 에 will-change: 매 GPU memory 의 explosion — 매 sparingly.
Sync JS 의 <head>: 매 parser block — 매 defer 의 사용.
@import chain: 매 sequential CSS load — 매 <link> 의 use.
Layout-trigger animation: 매 top/left/width 의 transition — 매 transform 의 substitute.