What problem does it solve? Rust developers often struggle to locate performance bottlenecks, choose the right compiler optimization settings, and verify that optimizations actually improve runtime. This Skill provides structured guidance for profiling, benchmarking, and optimizing Rust programs with measurable results. ## Core Features & Use Cases - Benchmarking with Criterion: Set up criterion 0.5 micro-benchmarks with benchmark groups, throughput metrics, and input-size comparisons to quantify optimization effects. - Profiling Toolchain: Use cargo flamegraph, perf, DHAT, and cargo-show-asm to identify CPU hotspots, heap allocation patterns, and verify inlining or vectorization. - Compiler & Memory Optimization: Configure Cargo profiles (opt-level, LTO, codegen-units), select fast HashMap hashers (ahash, FxHash), apply arena allocators (bumpalo), and design SIMD-friendly SoA data layouts. - Use Case: When a Rust service shows high latency, use this Skill to generate a flamegraph, identify that unnecessary .clone() calls dominate the hot path, replace them with borrows or Cow, and confirm the improvement with a criterion baseline comparison. ## Quick Start Ask the AI to help you set up a criterion benchmark and flamegraph profiling workflow to find and fix the performance bottleneck in your Rust function.