simplify-trace

작성자: tldraw

큰 Chrome DevTools 성능 트레이스를 간결한 마크다운 보고서로 요약하여 전체 파일을 로드하지 않고도 분석할 수 있도록 합니다. 다음과 같은 경우에 사용합니다…

npx skills add https://github.com/tldraw/tldraw --skill simplify-trace

Simplify trace

Chrome DevTools performance traces are tens to hundreds of MB of JSON — far too large to read directly. This skill turns one into a few-KB markdown report that surfaces the work taking too long or happening too often.

Usage

Run the script on the trace file. It prints markdown to stdout (or --out FILE):

node skills/simplify-trace/scripts/simplify-trace.mjs <trace.json> [--top N] [--long-task-ms MS] [--window START-END] [--out report.md]
  • --top N — rows per table (default 25).
  • --long-task-ms MS — long-task threshold (default 50).
  • --window START-END — scope the whole report to a time slice (offsets in ms from trace start).
  • --only a,b / --except a,b / --all — pick which sections to emit.
  • --match TEXT — case-insensitive filter for rows (event names, function names, URLs).
  • --list — print the available section keys and exit.
  • --out FILE — write to a file instead of stdout.
  • Traces over ~500 MB: prefix node --max-old-space-size=8192.

Default to running with --out to a temp file for big traces, then read the report. Don't read the raw trace.

Sections

Default sections: summary, longtasks, events, frequent, functions, categories. Opt-in: timeline (per-second main-thread busy time — use to locate activity), network (resource/fetch waterfall with TTFB/duration/size), websocket (WebSocket lifecycle — /app/file doc sync). Run --list for the full set. Interrogate narrowly, e.g.:

# where is the activity? then window to it
node …/simplify-trace.mjs trace.json --only timeline
# what was the network/socket doing during the action?
node …/simplify-trace.mjs trace.json --only network,websocket --window 62000-69000 --match tldraw

The trace's metadata.startTime (ISO/UTC) anchors offset 0 to wall-clock, so trace offsets can be lined up against server logs (zero-cache, sync-worker) by timestamp. For an idle, network-quiet gap, the trace shows when but not why — add performance.mark()/console.timeStamp() in the client path and they appear on the trace timeline.

"What happens when I do X" traces

A recording of a single action (switch file, open menu) is mostly idle setup time, which dilutes the action across the whole trace. Window to the action instead:

  1. Run once with no window. Note where activity is — the long tasks' offsets, or bucket main-thread busy-time per second with a quick inline script to find the active span.
  2. Re-run with --window START-END around that span. All tables then describe only the action.

The recording artifact CpuProfiler::StartProfiling (the profiler turning on, ~50–60ms) is excluded from the long-task table, including when it's nested inside a RunTask. If long tasks shows "None", the action genuinely has no single blocking task — look at aggregate self time, GC, and animation-loop events instead.

What the report contains

  • Header — event count, wall-clock span, sampled JS CPU time, and idle %.
  • Long tasks — top-level tasks over the threshold (main-thread jank), with the time offset where each occurred.
  • Hottest event types (self time) — where engine/browser time actually goes (layout, GC, paint, function calls), excluding time spent in nested children.
  • Most frequent event types (count) — work happening too often.
  • Hottest JS functions — bottom-up self time from the embedded V8 CPU profile, with file:line. Synthetic (idle)/(program) frames are excluded here (idle is in the header).
  • Self time by category — high-level breakdown across trace categories.

How to read it

  • A function high in self time is the actual cost; high total but low self means the cost is in its callees — follow the call tree.
  • High count with low avg = death by a thousand cuts (often a reactive/render loop firing too often); investigate why it fires, not its per-call cost.
  • Long tasks point at when jank happened; cross-reference the offset against what the user was doing.
  • Minified names (r, Tg) come with a file:line — use it to locate the source.

The script only summarizes; it does not modify the trace.

tldraw의 다른 스킬

review-docs
tldraw
문서를 병렬 평가와 반복적 개선 루프를 통해 검토하고 개선합니다.
official
clean-copy
tldraw
현재 브랜치를 깔끔하고 서사적인 품질의 git 커밋 기록을 가진 새 브랜치로 재구현합니다. 깔끔한 복사 브랜치를 만들거나 커밋을 정리하라는 요청이 있을 때 사용하세요.
official
commit-changes
tldraw
현재 변경 사항에 대한 git 커밋을 생성합니다. 커밋 요청, 커밋 생성, 커밋 메시지 생성, 또는 현재 작업 트리를 커밋하라는 요청을 받았을 때 사용합니다.
official
dotcom-release-crew
tldraw
Post to the
official
dotcom-release-marketing
tldraw
이번 주 tldraw.com(dotcom) 릴리스에서 제공되는 내용을 평이한 언어로 요약하여 마케팅 팀의 Discord 채널에 게시합니다. 준비할 때 사용하세요…
official
issue
tldraw
사용자 설명을 바탕으로 tldraw 저장소에 GitHub 이슈를 생성하고 조사합니다. 사용자가 이슈를 언급하거나, 이슈 생성을 요청하거나, 버그를 신고할 때 사용합니다.
official
pr
tldraw
현재 브랜치를 tldraw 저장소에 풀 리퀘스트로 생성하거나 업데이트합니다. 사용자가 pr을 호출하거나, PR 생성을 요청하거나, 기존 PR을 업데이트하거나, 푸시할 때 사용합니다.
official
pr-walkthrough
tldraw
풀 리퀘스트의 내레이션이 포함된 비디오 워크스루를 코드 슬라이드와 오디오 내레이션으로 생성합니다. PR 워크스루, PR 비디오 또는 워크스루를 요청받았을 때 사용하세요.
official