investigate-puffin
यह क्या करती है
यह स्किल आपके AI से Puffin प्रोफ़ाइलर रिकॉर्डिंग खुलवाती है और पता लगाती है कि ऐप का कौन सा हिस्सा सबसे ज़्यादा समय लेता है। यह उन डेवलपर्स के लिए है जो बदलाव से पहले और बाद में परफ़ॉर्मेंस जाँचना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आपके पास .puffin फ़ाइल है और आप जानना चाहते हैं कि कौन सा कोड धीमा है।
- ✓जब आप किसी बदलाव से पहले के ट्रेस की तुलना उसके बाद के ट्रेस से करना चाहते हैं।
- ✓जब आप अपने AI से प्रोफ़ाइल पढ़ने के लिए rerun dump-puffin कमांड इस्तेमाल करने को कहते हैं।
Skill का लिंक
https://github.com/rerun-io/rerun/blob/main/skills/investigate-puffin/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस .puffin रिकॉर्डिंग को देखकर बताइए कि कौन से फ़ंक्शन सबसे ज़्यादा समय लेते हैं।”
हर हफ़्ते 5 नई skills, 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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
rerun-blueprint
12kआपके एजेंट को ब्लूप्रिंट लिखकर Rerun व्यूअर का लेआउट, व्यू और छिपे कॉलम बदलना सिखाती है।
rerun-catalog-queries
12kयह आपके एजेंट को Python से Rerun कैटलॉग पर क्वेरी तेज़ करने में मदद करती है, राउंड ट्रिप, डेटा आकार और धीमी रीड के सुझावों के साथ।
rerun-chunk-processing
12kआपके एजेंट को Rerun डेटा पाइपलाइन बनाना सिखाती है, जो रीडर और लेंस से MCAP, Parquet, वीडियो या RRD फ़ाइलों को रिकॉर्डिंग में बदलती है।
rerun-data-model
12kयह आपके एजेंट को रोबोट या मल्टीमोडल डेटा को Rerun के डेटा मॉडल में रखने में मदद करती है: एंटिटी, कंपोनेंट और स्टैटिक मान तय करके।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।