--- name: samply description: Analyze Samply Firefox-profiler output, record focused profiles, summarize hot threads/stacks, inspect symbolication, and compare profile evidence before and after a performance change. --- # Samply ## Overview Use this skill when a task involves Samply recordings or Firefox-profiler JSON, especially `profile.json.gz` files, `samply record`, `samply load`, symbolication, thread timeline skew, or hot stack interpretation. Keep the loop evidence-driven: establish a focused baseline, record the exact target, summarize the profile before deep code reading, make one scoped change, and rerun the same target. This skill is intentionally project-agnostic. Any project-specific benchmark harness, environment variables, metrics, or logging commands should live in a separate benchmark skill or in the current task context. ## Share Evidence Early Do not disappear into profile spelunking while useful output is already available. As soon as a timing run finishes, report the timing lines or comparison table before starting deeper analysis. As soon as a profile summary is available, report the top threads/functions/stacks before reading more code. Then continue investigating with those facts visible. For long performance sessions, use this cadence: 1. timing command starts: say what target, input, mode, and runtime toggles are being measured; 2. timing command finishes: immediately show timing results and output path; 3. profile command finishes: immediately show profile path, a `samply load` command the user can run to inspect it in Firefox Profiler, and the first stack/function summary; 4. deeper analysis begins: state the concrete hotspot or hypothesis being checked. ## Standard Loop 1. Check branch state and changed surface when working in a repository: ```bash git status --short git branch --show-current git diff --stat ``` 2. Run a focused timing command before profiling. Prefer one executable, one workload/input, one mode, and enough iterations to smooth obvious noise. If the experiment has a runtime environment toggle, prefix every timing and profile command with the same env setting; this is often faster than recompiling and makes A/B comparisons clearer. Generic shape: ```bash FEATURE_TOGGLE=1 --iterations 5 --output /tmp/