perf-rust

Profile, benchmark, and optimize Rust applications using cargo flamegraph, criterion, and LLVM flags.

Updated Feb 19, 2026
One-click install
npx skills add https://github.com/kunallimaye/lib-agents --skill perf-rust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: perf-rust
Source: https://github.com/kunallimaye/lib-agents/tree/main/skills/perf-rust
Command: npx skills add https://github.com/kunallimaye/lib-agents --skill perf-rust

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers identify and resolve performance bottlenecks in Rust applications by providing tools and methodologies for profiling, benchmarking, and optimizing code.

Core Features & Use Cases

  • Profiling: Guides Rust profiling using tools like cargo flamegraph, samply, and platform-specific profilers.
  • Benchmarking: Documents benchmarking patterns with libraries such as criterion, divan, and iai.
  • Optimization: Covers LLVM compiler internals, codegen flags, and memory/allocation strategies for high-performance Rust code.
  • Use Case: You have a Rust service that is experiencing high CPU usage. Use this Skill to generate a flame graph, identify the hottest functions, and apply optimization techniques like reducing allocations or tuning compiler flags.

Quick Start

Use the perf-rust skill to generate a flame graph for the 'my-app' binary.

Frequently Asked Questions about perf-rust

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify performance bottlenecks in a Rust application?

To identify performance bottlenecks in a Rust application, you can generate a flame graph using `cargo flamegraph` or `samply` to locate the hottest functions consuming high CPU usage for targeted optimization.

What's the best way to benchmark Rust code for performance tuning?

The best way to benchmark Rust code for performance tuning involves using libraries like `criterion`, `divan`, or `iai` to measure execution time and detect regressions during optimization.

How do LLVM compiler flags affect Rust memory allocation and performance?

LLVM compiler flags and codegen settings affect Rust memory allocation and performance by influencing how the compiler generates machine code, enabling deep optimization of CPU usage and allocation strategies.

When should I profile Rust code to reduce high CPU usage?

You should profile Rust code to reduce high CPU usage when your service experiences unexpected slowdowns, allowing you to analyze compiler-generated code and apply techniques like reducing allocations to resolve bottlenecks.

Does cargo flamegraph work for optimizing Rust memory allocation strategies?

`cargo flamegraph` works for optimizing Rust memory allocation strategies by visualizing CPU usage across call stacks, helping you pinpoint exactly where to apply code optimization techniques to reduce allocations.