rust-profiling

Rust profiling skill for performance analysis. Use when generating flamegraphs from Rust binaries, measuring monomorphization bloat with cargo-llvm-lines, analysing binary size with cargo-bloat, microbenchmarking with Criterion, or interpreting inlined frames in profiles. Activates on queries about

By mohitmishra786 · 449 installs

npx skills add mohitmishra786/low-level-dev-skills --skill rust-profiling

Source repository · Upstream listing

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 2. Flamegraphs with cargo flamegraph Custom flamegraph options: 3. Binary size analysis with cargo bloat Typical output: 4. Monomorphization bloat with cargo llvm lines Typical output: High Copies count = monomorphization expansion. Fix: 5. Criterion microbenchmarks 6. perf with Rust (Linux) Rust specific perf tips: Build with debug = 1 (line tables only) for faster builds with line level attribution Use RUSTFLAGS=" C force frame pointers=yes" for better call graphs without DWARF unwinding Disable ASLR for reproducible addresses: setarch $(uname m) R ./myapp 7. heaptrack / DHAT for allocations For flamegraph setup and Criterion configuration, see [references/cargo flamegraph setup.md](references/cargo flamegraph setup.md). Related skills Use skills/rust/rustc basics for build configuration (debug symbols, profiles) Use skills/profilers/linux perf for perf fundamentals Use skills/profilers/flamegraphs for reading and interpreting flamegraph SVGs Use skills/profilers/valgrind for allocation profiling with massif/DHAT