f8b21af4be
10_Wiki/Topics 대규모 정리: - 오류 캡처/미완성 stub 문서 227개 제거 - 교차폴더 중복 43클러스터 병합 (63파일 → redirect) - 링크명 정규화: 깨진 링크 수정·redirect 직결·개념 매핑 ~2,400건 - 카테고리 MOC 6개 신규 생성 - Graph 섹션 미해결 related-keyword 링크 10,058건 제거 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5.6 KiB
5.6 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-브라우저-렌더링-프로세스-crp | 브라우저 렌더링 프로세스 (CRP) | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
브라우저 렌더링 프로세스 (CRP)
매 한 줄
"매 byte → pixel 의 6-stage pipeline". CRP는 HTML/CSS/JS bytes 가 actual pixels 가 되기 전 거치는 parse → DOM/CSSOM → Render Tree → Layout → Paint → Composite 단계. 매 stage 차단/지연 의 LCP, INP regression 의 root cause.
매 핵심
매 6-stage pipeline
- Parse: HTML byte stream → token → DOM. CSS bytes → CSSOM (render-blocking).
- Render Tree: DOM + CSSOM merge,
display:none제외. - Layout (Reflow): 매 element 의 geometric box (x, y, w, h) 계산.
- Paint: pixels 의 layer 별 raster (text, color, image, shadow).
- Composite: GPU 의 layer 합성 —
transform,opacity만 매 단계 처리 가능.
매 차단 요소
- CSS 매 default render-blocking —
<head>의 위치 의 영향. <script>매 default parser-blocking —defer/async의 회피.- Synchronous JS 매 layout 강제 (forced reflow / layout thrashing).
매 응용
- LCP 최적화 — critical CSS inline + preload hero image.
- INP 최적화 — long task 분할,
requestIdleCallback활용. - Composite-only animation —
transform/opacity만 60fps 보장.
💻 패턴
Critical CSS inline (LCP < 2.5s)
<head>
<style>
/* Above-the-fold critical CSS only */
body { margin: 0; font: 16px/1.5 system-ui; }
.hero { height: 100vh; background: #0a0a0a; }
</style>
<link rel="preload" href="/fonts/inter.woff2" as="font" crossorigin>
<link rel="stylesheet" href="/full.css" media="print" onload="this.media='all'">
</head>
Defer non-critical JS
<!-- parse 안 차단 — DOM 완료 후 실행 -->
<script defer src="/app.js"></script>
<!-- 매 즉시 download but execution 매 비동기 -->
<script async src="/analytics.js"></script>
Layout thrashing 회피
// 매 안 좋은 패턴 — read/write interleave 의 N forced reflow
boxes.forEach(box => {
const w = box.offsetWidth; // read (force layout)
box.style.width = (w * 2) + 'px'; // write (invalidate)
});
// 매 fix — batch read, batch write
const widths = boxes.map(b => b.offsetWidth); // batch read
boxes.forEach((b, i) => b.style.width = widths[i] * 2 + 'px'); // batch write
Composite-only animation
/* 매 GOOD — GPU compositor 의 처리, layout/paint skip */
.slide {
transform: translateX(0);
transition: transform 200ms ease-out;
will-change: transform; /* hint to compositor */
}
.slide.active { transform: translateX(100%); }
/* 매 BAD — 매 frame 의 layout + paint 야기 */
.slide-bad {
left: 0;
transition: left 200ms;
}
CSS containment (scope reflow)
.card {
contain: layout style paint; /* 매 card 의 reflow 가 outer 에 전파 안 됨 */
content-visibility: auto; /* offscreen skip */
}
INP 최적화 — yield to main thread
async function processLargeList(items) {
for (let i = 0; i < items.length; i++) {
process(items[i]);
if (i % 50 === 0) {
await new Promise(r => setTimeout(r, 0)); // yield
}
}
}
// 매 modern API (2026)
function yieldToMain() {
return scheduler.yield ? scheduler.yield() : new Promise(r => setTimeout(r));
}
PerformanceObserver — measure CRP
new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
console.log(entry.name, entry.startTime, entry.duration);
}
}).observe({ type: 'largest-contentful-paint', buffered: true });
new PerformanceObserver((list) => {
for (const e of list.getEntries()) {
if (e.duration > 50) console.warn('Long task:', e);
}
}).observe({ type: 'longtask', buffered: true });
매 결정 기준
| 상황 | Approach |
|---|---|
| Hero image LCP 느림 | <link rel=preload> + fetchpriority=high |
| Animation jank | transform/opacity 만, will-change hint |
| 큰 list scroll lag | content-visibility: auto |
| Form input INP > 200ms | scheduler.yield(), debounce |
| Third-party script blocking | async + Partytown |
기본값: defer non-critical JS, inline critical CSS, composite-only animation.
🔗 Graph
- 부모: Web Performance · Core Web Vitals Optimization (INP, LCP 개선)
- 변형: Server Side Rendering (SSR) · Streaming SSR
🤖 LLM 활용
언제: jank/LCP/INP 회귀 진단, animation 최적화, third-party script 영향 분석. 언제 X: 매 framework-specific reactivity (React reconciler) 매 별도 layer — CRP 만 으로 안 풀림.
❌ 안티패턴
document.write사용: parser block, modern browser 의 무시.- synchronous XHR: main thread block, INP 파괴.
- inline script after CSS: CSSOM wait 의 parser stall.
- animate
width/top: 매 frame layout — composite-only 만 사용. @importin CSS: serialize CSS download —<link>의 사용.
🧪 검증 / 중복
- Verified (web.dev — Critical Rendering Path, Chrome DevTools Performance panel docs).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — CRP 6-stage pipeline + LCP/INP patterns |