m10-performance

Analyze Rust performance bottlenecks using cargo bench, flamegraph, and criterion.

1.4k|110|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/actionbook/rust-skills --skill m10-performance-actionbook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: m10-performance
Source: https://github.com/actionbook/rust-skills/tree/main/skills/m10-performance
Command: npx skills add https://github.com/actionbook/rust-skills --skill m10-performance-actionbook

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps Rust developers locate and fix performance bottlenecks by guiding a disciplined workflow: measure first, identify hotspots, and apply targeted optimizations to reduce allocations, improve cache locality, and enhance parallelism.

Core Features & Use Cases

  • Profiling and Benchmarking: Use cargo bench, flamegraph, and criterion to quantify performance.
  • Memory and Cache Optimizations: Techniques to reduce allocations and improve data locality.
  • Parallelism and Concurrency: Apply rayon or multithreading to scale CPU-bound workloads.
  • Use Case: You have a Rust service that handles high-throughput data; this skill helps you find slow paths and propose fixes with minimal regressions.

Quick Start

Run cargo bench to baseline performance, install flamegraph, and generate a visual flamegraph for hotspots.

Frequently Asked Questions about m10-performance

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

FAQPage Schema
How do I find performance bottlenecks in my Rust project?

To find Rust performance bottlenecks, you should measure first using cargo bench and generate a flamegraph to identify hotspots before applying targeted optimizations like reducing allocations or improving cache locality.

What is the best way to benchmark Rust code for high-throughput workloads?

The best way to benchmark Rust code is using criterion with cargo bench to establish measurable baselines, which helps quantify performance and ensure optimizations yield repeatable results without regressions.

Can I use flamegraph to analyze memory and cache locality issues in Rust?

Yes, flamegraph helps analyze CPU hotspots, while specific memory and cache optimizations in Rust involve techniques to reduce allocations and improve data locality based on those profiling measurements.

How do I scale CPU-bound Rust workloads with parallelism?

To scale CPU-bound Rust workloads, you can apply parallelism and concurrency using rayon or multithreading after establishing a baseline with cargo bench to verify the performance improvements.

Do I need measurable baselines before optimizing my Rust binary?

Yes, measurable baselines are required before optimizing a Rust binary to ensure a disciplined workflow where you pinpoint hotspots first and apply targeted optimizations that yield repeatable results.

When should I not use flamegraph for Rust profiling?

Flamegraph may be limited if you lack measurable baselines from cargo bench, as profiling requires established toolchains and quantifiable data to accurately identify hotspots and apply targeted optimizations.