investigate-puffin
하는 일
이 스킬은 AI가 Puffin 프로파일러 기록을 열고, 앱의 어느 부분이 가장 많은 시간을 쓰는지 찾도록 합니다. 변경 전후의 성능을 확인하고 싶은 개발자를 위한 스킬입니다.
사용하는 경우
- ✓.puffin 파일이 있고 어떤 코드가 느린지 알고 싶을 때.
- ✓변경 전 추적과 변경 후 추적을 비교하고 싶을 때.
- ✓rerun dump-puffin 명령으로 프로파일을 읽도록 AI에게 요청하는 경우.
스킬 링크
https://github.com/rerun-io/rerun/blob/main/skills/investigate-puffin/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 .puffin 기록을 살펴보고 어떤 함수가 가장 오래 걸리는지 알려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 rerun dump-puffin 명령으로 기록을 JSON으로 변환한 뒤, 작은 도우미 스크립트로 가장 느린 구간을 찾고 두 번의 실행을 비교합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Investigate puffin traces
Analyze a .puffin recording from an application instrumented with Puffin.
Use the recording path supplied by the user. Or use the capture_profile_trace message if using the rerun MCP.
Setup
Requires the rerun CLI (Rerun 0.38 or later), Python 3.10 or later, and jq.
The Python helpers use only the standard library.
Set PUFFIN_SKILL_DIR to the absolute directory containing this SKILL.md.
In Claude Code, you can use export PUFFIN_SKILL_DIR="${CLAUDE_SKILL_DIR}"; in other agents, resolve the directory from the installed skill location.
Dump the trace to a file and check scope registration:
rerun dump-puffin <path> > /tmp/puffin.json
jq '.scopes | length' /tmp/puffin.json
If no (recent enough) rerun binary is on the path but you are in a Rerun checkout, run the sub-command from source instead:
cargo run --quiet -p rerun-cli --no-default-features -- dump-puffin <path> > /tmp/puffin.json
Always dump to a file.
.puffin traces can produce many MB of JSON, so query the saved JSON instead of reading it all into context.
If .scopes | length is 0, names fall back to scope#<id> and source locations are missing.
Ask for a new capture that includes scope registration if names are needed for the investigation.
If another capture is not feasible, proceed with dynamic data labels and explain the limits.
Check the registration table after exporting: do not assume that every capture tool or version preserves it.
How traces are captured
Use the application's Puffin capture or export support to save a .puffin file.
For applications serving profiling data through puffin_http, connect a compatible puffin_viewer and export the recording.
The dumper uses Puffin 0.20; captures from incompatible format versions may require a matching parser.
Rerun-specific examples:
- Native viewer / CLI: enable the built-in Puffin server from the UI.
- Python SDK: set
RERUN_PUFFIN=1before importingrerunto stream profiling data topuffin_viewer. - Rust binaries using
re_tracing: keep are_tracing::Profileralive for the capture and call itsstart()method with server support enabled. It starts a server and attempts to launchpuffin_viewer.
Investigate with jq
The JSON layout:
{
"file": "preview.puffin",
"scopes": { "<id>": { name, function, file, line, kind } }, # may be empty — see Setup
"frames": [
{
"frame_index": …,
"range_ns": [start, end],
"duration_ns": …,
"num_scopes": …,
"threads": [
{
"name": "main",
"num_scopes": …, "depth": …, "range_ns": […],
"scopes": [ { id, name, start_ns, duration_ns, data, children: […] } ]
}
]
}
]
}
name on each scope is resolved from the scopes map.
data is the dynamic per-call string, such as an event type or a mesh name.
Recipes
Footgun: any .. | objects | select(.name? == …) pattern MUST also select(has("duration_ns")).
.. walks every object in the tree, including entries in the top-level scopes registration map, which have .name but no .duration_ns.
Without the guard you will hit null / 1e6 errors or sort against null.
Every recipe below includes the guard, keep it when adapting them.
Prefer find_scopes.py for name/data lookups. If you just want "slowest matches of X", "total time grouped by name" or "all scopes matching X on thread Y", reach for find_scopes.py instead of writing jq, it's shorter and bakes the guard in.
See "Looking for a scope by prefix" below.
Use the jq recipes here when you need something the script does not cover (children of a specific scope, cross-thread windows, time-ordered traversal).
# overall shape — sorted slowest first so the bad frames jump out
jq '.frames | map({i: .frame_index, ms: (.duration_ns / 1e6), scopes: .num_scopes}) | sort_by(-.ms)' /tmp/puffin.json
# per-thread totals for the slowest frame
jq '.frames | sort_by(-.duration_ns) | .[0].threads | map({name, num_scopes, depth, ms: ((.range_ns[1] - .range_ns[0]) / 1e6)})' /tmp/puffin.json
# top 10 slowest individual scopes (recursive descent over the whole tree)
# also doable as: find_scopes.py /tmp/puffin.json '' --top 10
jq '[.. | objects | select(has("duration_ns") and has("name"))]
| sort_by(-.duration_ns) | .[0:10]
| map({name, data, ms: (.duration_ns / 1e6)})' /tmp/puffin.json
# total time per scope name (best-effort: group
자주 묻는 질문
무엇을 설치해야 하나요?
rerun 명령줄 도구 0.38 이상, Python 3.10 이상, jq가 필요합니다.
추적 결과를 파일로 저장하는 이유는 무엇인가요?
Puffin 추적은 수 메가바이트가 될 수 있어서, 이 스킬은 전체를 읽지 않고 저장된 JSON을 조회합니다.
이름이 scope#처럼 보이면 어떻게 하나요?
기록에 범위 이름이 없다는 뜻이며, 이 스킬은 이름이 포함된 새 캡처를 요청합니다.
상세 정보
작성자의 원본 설명
Investigate Puffin profiler recordings (.puffin files), find slow scopes, and compare before/after traces using the `rerun dump-puffin` command and bundled analysis helpers.
repo: rerun-io/rerun
인기도
- GitHub 스타
- 12k
- 순위
- #11547
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
rerun-blueprint
12k에이전트가 블루프린트를 작성해 Rerun 뷰어의 모습을 바꾸도록 가르칩니다. 레이아웃, 뷰, 숨긴 열을 포함합니다.
rerun-catalog-queries
12k에이전트가 Python에서 Rerun 카탈로그를 더 빠르게 조회하도록 돕습니다. 왕복 호출, 데이터 크기, 느린 데이터셋 읽기에 대한 팁을 제공합니다.
rerun-chunk-processing
12k에이전트에게 리더와 렌즈로 Rerun 데이터 파이프라인을 만드는 법을 가르칩니다. MCAP, Parquet, 비디오, RRD 파일을 녹화로 변환합니다.
rerun-data-model
12k에이전트가 로봇이나 멀티모달 데이터를 Rerun 데이터 모델에 대응시키도록 돕습니다. 엔티티, 컴포넌트, 정적 값 또는 시간 기반 값을 먼저 정합니다.