rust-profiling
БесплатноЗапускает вложенные скриптыНе проверенProfile Rust code using samply and related evidence to identify CPU bottlenecks, allocation hot paths, allocator-fragmentation symptoms, and per-entry memory…
от blacktop★ 17 звёзд на GitHubОб этом скилле
Rust Profiling with Samply
Profile Rust binaries to find CPU bottlenecks and allocation pressure using samply, then use OS-level memory evidence when RSS or fragmentation is the symptom.
Quick Start
# 1. Ensure profiling profile exists in Cargo.toml (see reference.md)
# 2. Build with debug symbols
cargo build --profile profiling
# 3. Profile (opens Firefox Profiler UI)
samply record ./target/profiling/<binary> [args...]
# 4. Or save for CLI analysis
samply record --save-only -o profile.json ./target/profiling/<binary>
python3 ~/.agents/skills/rust-profiling/scripts/analyze_profile.py profile.json
Skill Files
| File | Purpose |
|---|---|
reference.md |
Cargo.toml setup, samply options, troubleshooting, measuring per-entry memory footprint |
examples.md |
Common profiling scenarios and analysis patterns |
optimization.md |
Post-profiling fixes: source patterns, shrinking long-lived data layouts, release-profile tuning, PGO, BOLT, what doesn't work, benchmark integrity (baseline, correctness oracle, anti-gaming rules) |
scripts/analyze_profile.py |
CLI tool to analyze saved profile.json files |
When to Use
- Performance is slower than expected
- RSS or heap usage grows unexpectedly under load
- Before optimizing (measure first!)
- After optimization (verify improvement)
- Investigating CPU-bound operations or allocation-heavy hot paths
- Shrinking the per-entry memory of a large cache, index, or table
When NOT to Use
- The task is a Rust correctness bug, API design question, or refactor without a performance symptom.
- The user already has a narrow benchmark request that does not need profiling guidance.
- The issue is build time, binary size, or dependency hygiene rather than runtime CPU, memory, or contention.
What to Look For
| Pattern | Meaning | Action |
|---|---|---|
| High self-time | Function itself is slow | Direct optimization target |
| High total-time | Called often or slow callees | Check call frequency |
malloc/alloc in hot path |
Allocation overhead | Preallocate, reuse, pool, or use bounded/shared buffers |
| RSS grows then plateaus while profiles show allocation churn | Possible allocator fragmentation, not necessarily a leak | Compare allocators, then reduce high-rate small allocations |
| RSS scales with entry count of a cache/index, profile looks cold | Per-entry layout overhead (capacity fields, enum padding, boxed variants) | Measure bytes/entry with a counting allocator, then shrink the layout (optimization.md) |
pthread_mutex/parking_lot |
Lock contention | Reduce lock scope or use lock-free |
| Speedup far larger than the change explains, or timings flat across input sizes | Work was skipped, not sped up | Run the correctness oracle and diff benches/ (optimization.md section 7) |
Установить rust-profiling в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл rust-profiling?
Profile Rust code using samply and related evidence to identify CPU bottlenecks, allocation hot paths, allocator-fragmentation symptoms, and per-entry memory overhead in long-lived data such as caches. Use when performance is slow, RSS grows unexpectedly or scales with cache size, before optimizing, or when the user asks to profile or shrink memory footprint.
Как установить скилл rust-profiling?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл rust-profiling запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic