Covers the full performance profiling stack for Rust: cargo-flamegraph for CPU profiles, cargo-bloat for binary size breakdowns, cargo-llvm-lines to catch monomorphization explosions, and Criterion for proper microbenchmarking. The workflow guides you through build profiles with debug symbols, interpreting flamegraph output with Rust's inlined frames, and the thin-wrapper pattern to reduce code bloat from generics. It also connects to perf and heaptrack when you need lower-level tooling. Straightforward and pragmatic. Use this when your Rust program is slow or fat and you need to figure out why.

skills.sh installs
673
GitHub stars
279
last updated
Aug 21, 2026

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill rust-profiling --agent claude-code

Installs into .claude/skills of the current project.

Files

Rust Profiling

Purpose

Guide agents through Rust performance profiling: flamegraphs via cargo-flamegraph, binary size analysis, monomorphization bloat measurement, Criterion microbenchmarks, and interpreting profiling results with inlined Rust frames.

Triggers

  • "How do I generate a flamegraph for a Rust program?"
  • "My Rust binary is huge — how do I find what's causing it?"
  • "How do I write Criterion benchmarks?"
  • "How do I measure monomorphization bloat?"
  • "Rust performance is worse than expected — how do I profile it?"
  • "How do I use perf with Rust?"

Workflow

1. Build for profiling

# Release with debug symbols (needed for readable profiles)
# Cargo.toml:
[profile.release-with-debug]
inherits = "release"
debug = true

cargo build --profile release-with-debug

# Or quick: release + debug info inline
CARGO_PROFILE_RELEASE_DEBUG=true cargo build --release

2. Flamegraphs with cargo-flamegraph

# Install
cargo install flamegraph

# Linux: uses perf (requires perf_event_paranoid ≤ 1)
sudo sh -c 'echo 1 > /proc/sys/kernel/perf_event_paranoid'
cargo flamegraph --bin myapp -- arg1 arg2

Sponsors

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
Categories
Debugging, Rust
First seen
Jun 3, 2026

More from mohitmishra786/low-level-dev-skills

All 54

Recommended

More Debugging
1astronomer avatartroubleshooting-astro-deploymentsastronomer/agentsTroubleshoot Astronomer production deployments with Astro CLI. Use when investigating deployment issues, viewing production logs, analyzing failures, or managin655skills.sh installs
2new-silvermoon avatarcompose-performance-auditnew-silvermoon/awesome-android-agent-skillsAudit and improve Jetpack Compose runtime performance from code review and architecture. Use when asked to diagnose slow rendering, janky scrolling, excessive r596skills.sh installs
3mohitmishra786 avatardebug-optimized-buildsmohitmishra786/low-level-dev-skillsDebugging optimized builds skill for diagnosing issues in release code. Use when debugging RelWithDebInfo builds, using -Og for debuggable optimization, working579skills.sh installs
4aliyun avataralibabacloud-ram-permission-diagnosealiyun/alibabacloud-aiops-skillsAlibaba Cloud RAM permission diagnosis and repair assistant. When an agent encounters any permission-related error while operating Alibaba Cloud resources (403,555skills.sh installs
5tuist avatardebug-generated-projecttuist/agent-skillsDebugs issues users encounter with Tuist-generated projects by reproducing the scenario locally, building Tuist from source when needed, and triaging whether it533skills.sh installs
6aj-geddes avatarapi-error-handlingaj-geddes/useful-ai-promptsImplement comprehensive API error handling with standardized error responses, logging, monitoring, retry logic, and validation patterns. Use when building resil513skills.sh installs