c24165b8bc
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5.1 KiB
5.1 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-성능-최적화-reflow-repaint | 성능 최적화(Reflow & Repaint) | 10_Wiki/Topics | verified | self |
|
none | A | 0.93 | applied |
|
2026-05-10 | pending |
|
성능 최적화(Reflow & Repaint)
매 한 줄
"매 layout(=reflow) 의 비싸고, paint 의 cheap-er, composite 의 cheapest". 매 DOM/CSS write 의 invalidate 의 trigger — geometry change → reflow + repaint, color-only change → repaint, transform/opacity → composite-only. Layout thrashing 의 batch read/write 의 fix.
매 핵심
매 cost ladder
- Composite only (cheap, 60fps):
transform,opacity,filter(some). - Paint (medium):
color,background-color,box-shadow,border-radius. - Layout (Reflow) (expensive):
width,height,top/left,margin,padding,font-size,display. - Full reflow trigger:
<html>font change, viewport resize.
매 reflow triggers (write)
- DOM 의 add/remove.
display/positionchange.- size/box-model property change.
- font/text content change.
- pseudo-class (
:hover) 의 layout-affecting style.
매 forced sync layout (read)
offsetTop/Left/Width/Height,clientTop/...,scrollTop/....getComputedStyle(),getBoundingClientRect().- 매 pending invalidation 의 있을 때 read → 매 browser 의 immediate layout 의 trigger.
💻 패턴
Layout thrash 의 fix (read-then-write)
// X — N reflow (each iteration forces layout)
boxes.forEach(b => {
const w = b.offsetWidth;
b.style.width = (w + 10) + 'px';
});
// O — 1 reflow (read all, then write all)
const widths = boxes.map(b => b.offsetWidth);
boxes.forEach((b, i) => b.style.width = (widths[i] + 10) + 'px');
requestAnimationFrame batching
let pending = false;
function update(el) {
if (pending) return;
pending = true;
requestAnimationFrame(() => {
el.style.transform = `translateX(${nextX}px)`;
pending = false;
});
}
window.addEventListener('scroll', () => update(stickyEl));
Detach → mutate → reattach (huge DOM ops)
const list = document.getElementById('list');
const fragment = document.createDocumentFragment();
for (const item of items) {
const li = document.createElement('li');
li.textContent = item.name;
fragment.appendChild(li);
}
list.appendChild(fragment); // 1 reflow, not N
transform 의 substitute (animation)
/* X — top change → reflow per frame */
@keyframes slide-bad { from { top: 0 } to { top: 100px } }
/* O — transform → composite only */
@keyframes slide-good { from { transform: translateY(0) } to { transform: translateY(100px) } }
will-change (sparingly)
/* 매 animation 직전 의 hint, 매 finish 후 remove */
.card { will-change: transform; }
.card.done { will-change: auto; }
contain (CSS containment)
/* 매 subtree 의 layout/paint 의 isolate — outer 의 invalidation 의 not propagate */
.widget { contain: layout paint; }
Position fixed/sticky (composite layer)
.toolbar {
position: sticky; top: 0;
/* GPU layer — scroll 시 reflow 없음 */
}
IntersectionObserver (no scroll handler)
const io = new IntersectionObserver((entries) => {
for (const e of entries) {
if (e.isIntersecting) e.target.classList.add('in-view');
}
}, { rootMargin: '0px 0px -10% 0px' });
images.forEach(img => io.observe(img));
매 결정 기준
| 변경 | Cost |
|---|---|
transform / opacity |
composite only — 60fps OK |
background-color |
paint — usually OK |
top/left/width/height |
layout — animation 의 avoid |
display |
layout — modal toggle 의 OK, animation 의 X |
font-size (root) |
full document reflow — extreme cost |
기본값: 매 animation → transform/opacity 만, batch read/write, large insert → DocumentFragment, off-screen → content-visibility / IntersectionObserver.
🔗 Graph
🤖 LLM 활용
언제: layout thrash 의 detect (read-write interleave pattern), animation property 의 review. 언제 X: actual paint profiling — Chrome DevTools Performance/Layers panel 의 use.
❌ 안티패턴
will-changeeverywhere: 매 GPU memory exhaustion.top/leftanimation: 매 reflow per frame —transform의 substitute.- scroll handler 의 layout read: 매 thrash — IntersectionObserver 의 use.
innerHTML의 loop: 매 N reflow — fragment 의 build.
🧪 검증 / 중복
- Verified (web.dev/articles/animations-guide, Paul Lewis "Avoid Large, Complex Layouts", CSSOM View spec).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — reflow trigger + 8 패턴 + 결정 기준 의 정리 |