docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
---
|
||||
id: wiki-2026-0508-렌더링-최적화-개념-설명-자료
|
||||
title: 렌더링 최적화 개념 설명 자료
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [Rendering Optimization, Web Rendering Performance, Frontend Rendering]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [rendering, performance, web, browser, optimization]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: JavaScript
|
||||
framework: Browser
|
||||
---
|
||||
|
||||
# 렌더링 최적화 개념 설명 자료
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 frame 60fps = 16.67ms budget. 매 그 budget 안에서 layout / paint / composite 모두 끝나야 한다"**. Browser 매 critical rendering path 의 각 단계 (Parse → Style → Layout → Paint → Composite) 의 cost 를 이해하고, 매 reflow 를 최소화하고 GPU compositing layer 로 offload 하는 것이 매 핵심.
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 Critical Rendering Path
|
||||
1. **Parse HTML** → DOM tree
|
||||
2. **Parse CSS** → CSSOM
|
||||
3. **Style** → DOM + CSSOM 합쳐 Render Tree
|
||||
4. **Layout (Reflow)** → 매 element 의 geometry (x, y, w, h) 계산
|
||||
5. **Paint** → pixel 채우기 (color, image, shadow)
|
||||
6. **Composite** → GPU layer 합성
|
||||
|
||||
### 매 비싼 동작 ranking
|
||||
- **Layout (Reflow)**: 가장 비쌈. `width`, `height`, `top`, `left`, `font-size` 변경 → 매 reflow trigger.
|
||||
- **Paint**: 중간. `color`, `background`, `box-shadow` 변경.
|
||||
- **Composite only**: 매 cheap. `transform`, `opacity` 만 변경 → GPU 에서 처리.
|
||||
|
||||
### 매 응용
|
||||
1. **Animation**: `transform` / `opacity` 만 사용 (composite-only).
|
||||
2. **Scroll perf**: passive event listener, `will-change`.
|
||||
3. **Long list**: virtualization (react-window, virtual scroll).
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### Composite-only animation (60fps 보장)
|
||||
```css
|
||||
/* 매 BAD — reflow 매 frame */
|
||||
.bad { transition: left 300ms; }
|
||||
.bad.move { left: 200px; }
|
||||
|
||||
/* 매 GOOD — composite only */
|
||||
.good { transition: transform 300ms; will-change: transform; }
|
||||
.good.move { transform: translateX(200px); }
|
||||
```
|
||||
|
||||
### Batch DOM read/write (avoid layout thrashing)
|
||||
```javascript
|
||||
// 매 BAD — read/write/read/write → forced sync layout 매번
|
||||
elements.forEach(el => {
|
||||
const w = el.offsetWidth; // read (layout)
|
||||
el.style.width = (w * 2) + 'px'; // write (invalidate)
|
||||
});
|
||||
|
||||
// 매 GOOD — batch read first, then batch write
|
||||
const widths = elements.map(el => el.offsetWidth); // all reads
|
||||
elements.forEach((el, i) => {
|
||||
el.style.width = (widths[i] * 2) + 'px'; // all writes
|
||||
});
|
||||
```
|
||||
|
||||
### requestAnimationFrame (rAF) for animation
|
||||
```javascript
|
||||
function animate(ts) {
|
||||
const progress = (ts - start) / 300;
|
||||
el.style.transform = `translateX(${progress * 200}px)`;
|
||||
if (progress < 1) requestAnimationFrame(animate);
|
||||
}
|
||||
let start;
|
||||
requestAnimationFrame(t => { start = t; animate(t); });
|
||||
```
|
||||
|
||||
### Virtual list (long scrollable)
|
||||
```javascript
|
||||
// react-window pattern
|
||||
import { FixedSizeList } from 'react-window';
|
||||
<FixedSizeList height={600} itemCount={100000} itemSize={40} width={400}>
|
||||
{({ index, style }) => <div style={style}>Row {index}</div>}
|
||||
</FixedSizeList>
|
||||
```
|
||||
|
||||
### IntersectionObserver (lazy image)
|
||||
```javascript
|
||||
const io = new IntersectionObserver(entries => {
|
||||
entries.forEach(e => {
|
||||
if (e.isIntersecting) {
|
||||
e.target.src = e.target.dataset.src;
|
||||
io.unobserve(e.target);
|
||||
}
|
||||
});
|
||||
});
|
||||
document.querySelectorAll('img[data-src]').forEach(img => io.observe(img));
|
||||
```
|
||||
|
||||
### CSS containment
|
||||
```css
|
||||
/* 매 reflow scope 를 element 안으로 제한 */
|
||||
.card { contain: layout paint; }
|
||||
.list-item { content-visibility: auto; contain-intrinsic-size: 40px; }
|
||||
```
|
||||
|
||||
### Debounce expensive resize
|
||||
```javascript
|
||||
let raf;
|
||||
window.addEventListener('resize', () => {
|
||||
cancelAnimationFrame(raf);
|
||||
raf = requestAnimationFrame(() => recomputeLayout());
|
||||
});
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| micro-animation | `transform` / `opacity` + `will-change` |
|
||||
| 1000+ list items | virtualize (react-window) |
|
||||
| 화면 밖 image | `loading="lazy"` 또는 IntersectionObserver |
|
||||
| heavy paint area | `contain: paint` |
|
||||
| scroll jank | passive listener, `content-visibility` |
|
||||
|
||||
**기본값**: 매 transform/opacity animation + virtualize long list + lazy load images.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Frontend_Performance]] · [[Web_Vitals]]
|
||||
- 변형: [[Reflow_and_Repaint]] · [[Compositing]]
|
||||
- 응용: [[Lazy Loading]]
|
||||
- Adjacent: [[Core Web Vitals Optimization (INP, LCP, CLS)|Core_Web_Vitals]] · [[LCP]] · [[INP]] · [[CLS]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 60fps 안 나오는 페이지 진단, scroll jank, animation stutter, slow LCP.
|
||||
**언제 X**: server-side rendering bottleneck (그건 SSR 영역).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **`!important` 남용 으로 specificity battle**: 매 style recalc 비용 증가.
|
||||
- **inline style 매번 직접 set**: 매 batch 안 됨, layout thrash.
|
||||
- **`onscroll` 안에서 무거운 작업**: 매 throttle / rAF 필요.
|
||||
- **`transform` 없이 `top`/`left` 로 animation**: 매 매 frame reflow.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (web.dev rendering performance guide, MDN, Chrome DevTools docs).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — critical rendering path + reflow/composite optimization patterns |
|
||||
Reference in New Issue
Block a user