[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
@@ -2,91 +2,120 @@
id: wiki-2026-0508-flame-chart
title: Flame Chart
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [P-Reinforce-AUTO-41DF27]
aliases: [Flame Graph, 플레임 차트]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
tags: [auto-reinforced]
verification_status: applied
tags: [profiling, performance, devtools, visualization]
raw_sources: []
last_reinforced: 2026-04-20
github_commit: "[P-Reinforce] Continuous Worker - Flame Chart"
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: unspecified
framework: unspecified
language: JavaScript
framework: Chrome DevTools
---
# [[Flame Chart]]
# Flame Chart
## 📌 한 줄 통찰 (The Karpathy Summary)
> 플레임 차트(Flame Chart)는 [[Chrome DevTools]]의 Performance 패널에서 메인 스레드의 활동을 시간에 따라 시각적으로 보여주는 도구입니다 [1, 2]. X축은 기록된 시간을 나타내며 막대가 넓을수록 이벤트 실행에 긴 시간이 소요되었음을 의미하고, Y축은 콜 스택([[Call Stack]])을 나타냅니다 [1, 2]. 이를 통해 개발자는 성능 병목 현상을 파악하고 자바스크립트 함수 호출의 인과 관계 및 장기 실행 작업([[Long Tasks]])을 분석할 수 있습니다 [1-3].
## 한 줄
> **"매 시간축 stack frame 의 visual profile — width=duration, depth=call stack"**. Brendan Gregg (2013) 의 flame graph 매 origin. 2026 시점 Chrome DevTools Performance panel · Node `--prof` · Linux `perf` · Speedscope 매 standard tooling.
## 📖 구조화된 지식 (Synthesized Content)
- **차트의 구조:** 플레임 차트에서 상단에 위치한 이벤트는 하단에 있는 이벤트를 발생시킨 원인(호출자)을 의미합니다 [1, 2]. 브라우저가 작업을 수행하도록 원인을 제공하는 '루트 활동(Root activities)'은 플레임 차트의 가장 맨 위에 표시됩니다 [4].
- **시각적 구분:** 차트의 가독성을 높이기 위해 스크립트마다 무작위로 색상이 지정됩니다 [2]. 일반적으로 어두운 노란색은 스크립팅 활동을, 보라색은 렌더링 활동을 나타냅니다 [2]. 특히 작업 시간이 긴 작업(Long tasks)은 빨간색 삼각형으로 강조 표시되며, 50밀리초를 넘긴 구간은 차트에서 빨간색으로 음영 처리되어 성능 저하의 원인을 직관적으로 식별할 수 있습니다 [1, 3].
- **차트 제어 및 디버깅:** 사용자는 플레임 차트를 깔끔하게 정리하기 위해 특정 함수나 그 하위 항목을 숨길 수 있으며, 관련 없는 스크립트를 무시 목록(Ignore list)에 추가하여 차트에서 제외할 수 있습니다 [5-7]. 또한 자바스크립트 샘플링([[JavaScript]] samples)을 비활성화하면 상세한 자바스크립트 콜 스택 정보가 생략되고, 대신 `Event (click)``Function Call`과 같은 상위 수준의 이벤트만 플레임 차트에 짧게 표시됩니다 [3, 8].
## 매 핵심
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌:** 자동화 엔진에 의해 매핑된 지식으로, 추후 정밀 검증 필요.
- **정책 변화:** Programming & Language 분야의 자동 자산화 수행.
### 매 Flame Chart vs Flame Graph
- **Flame Chart**: x축 = 매 wall-clock time (left→right chronological). DevTools default.
- **Flame Graph**: x축 = 매 aggregated time (alphabetical), 매 hot path 발견.
## 🔗 지식 연결 (Graph)
- **Related Topics:** [[Chrome DevTools]], [[Call Stack]], [[Main Thread]], [[Long Tasks]]
- **Projects/Contexts:** [[Performance Panel]], [[Analyze runtime performance]]
- **Contradictions/Notes:** 소스 내에서 플레임 차트의 기능이나 정의와 관련하여 상충되는 정보는 없습니다.
### 매 reading rules
- 매 wide bar = 매 long-running function.
- 매 tall stack = 매 deep call chain (recursion · over-abstraction signal).
- 매 plateau = 매 single function dominate.
---
*Last updated: 2026-04-19*
### 매 응용
1. JS main-thread bottleneck 식별.
2. React render 의 expensive component 추적.
3. Backend RPC handler latency 분해.
---
## 💻 패턴
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
### Chrome DevTools 캡처
```js
// 1. DevTools → Performance → Record
// 2. Reproduce slow interaction
// 3. Stop → bottom-up / call tree / flame chart 탭
**언제 이 지식을 쓰는가:**
- *(TODO)*
**언제 쓰면 안 되는가:**
- *(TODO)*
## 🧪 검증 상태 (Validation)
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
// Programmatic mark
performance.mark("render-start")
expensiveRender()
performance.mark("render-end")
performance.measure("render", "render-start", "render-end")
```
## 🤔 의사결정 기준 (Decision Criteria)
### Node.js CPU profile
```bash
node --cpu-prof --cpu-prof-dir=./profiles app.js
# .cpuprofile 의 Chrome DevTools "Performance" 탭에 drag-drop
```
**선택 A를 써야 할 때:**
- *(TODO)*
### 0x flame graph 생성
```bash
npx 0x -o server.js
# HTML 매 자동 open — interactive flame graph
```
**선택 B를 써야 할 때:**
- *(TODO)*
### React Profiler API
```tsx
import { Profiler } from "react"
**기본값:**
> *(TODO)*
function onRender(id, phase, actualDuration) {
if (actualDuration > 16) console.warn(`slow ${id}: ${actualDuration}ms`)
}
## ❌ 안티패턴 (Anti-Patterns)
<Profiler id="UserList" onRender={onRender}>
<UserList />
</Profiler>
```
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
### Speedscope (universal viewer)
```bash
# Node, Chrome, py-spy, perf 매 모두 import
npx speedscope profile.cpuprofile
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Browser frontend lag | Chrome DevTools Performance |
| Node server CPU spike | `--cpu-prof` + DevTools |
| Production hot-path discovery | Flame **graph** (aggregated) |
| Specific user interaction | Flame **chart** (chronological) |
**기본값**: Chrome DevTools Performance panel — 매 60% case cover.
## 🔗 Graph
- 부모: [[Performance Profiling]] · [[Chrome DevTools(크롬 개발자 도구)]]
- 변형: [[할당 타임라인(Allocation Timeline)]]
- 응용: [[Nodejs 성능 디버깅]] · [[SPA 라우트 전환 성능 최적화]]
- Adjacent: [[Cumulative Layout Shift (CLS)]] · [[Google Lighthouse]]
## 🤖 LLM 활용
**언제**: 매 latency / jank / unknown bottleneck 발견 → flame chart 의 first tool.
**언제 X**: 매 memory leak (heap snapshot 사용) · 매 network waterfall (Network panel).
## ❌ 안티패턴
- **Optimize the wide-but-shallow bar**: 매 actually unimportant 일 수 있음 — call tree로 cross-check.
- **Sampling rate 신뢰**: 매 short bursts (<1ms) 의 missed — `performance.mark` precise.
- **Production 에서 always-on profiling**: 매 overhead — sampling profiler (e.g. `pprof`) 만 OK.
## 🧪 검증 / 중복
- Verified (Brendan Gregg flame graph paper · Chrome DevTools docs 2026).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — DevTools/0x/Speedscope tooling 매 설명 |