rust-performance
Installation
SKILL.md
Rust performance
Use this skill when a task names a performance problem or profiling shows a bottleneck. Treat correctness and the project's supported targets as constraints.
Establish a baseline
- Find a representative workload and define the metric that matters: latency distribution, throughput, peak memory, binary size, or startup time.
- Record the current result with the same compiler, target, features, input, and build mode that matter in production.
- Profile before changing code. Separate time in the program from time in I/O, dependencies, startup, or the benchmark harness.
- Make one focused change, rerun correctness checks, and compare against the baseline. Keep the change only if it improves the target metric without unacceptable costs elsewhere.
Use the project's existing benchmark and profiling tools. For a new benchmark, prefer a reproducible end-to-end workload over tiny synthetic loops that optimize away or fail to represent production. Avoid adding criterion, an allocator, or a profiling dependency without a reason.