Rust performance
Rust performance workflow for Criterion benchmarks, hyperfine CLI benchmarks, profiling, allocation analysis, async overhead, CPU/memory optimization, and before/after measurement in greenfield crates.From its SKILL.md
npx -y skills add nyquistwilder/personal-pi --skill rust-performanceAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.1 KB, 379 tokens by cl100k_base, as published. Nobody here has run it
Rust Performance
Rule
Measure before optimizing and preserve correctness. Prefer algorithmic improvements and allocation-aware design over clever unsafe or unreadable micro-optimizations.
Hard Stops
Stop when:
- No target metric or representative workload exists.
- Correctness tests do not protect the behavior being optimized.
- Optimization requires
unsafe, public API changes, feature changes, altered semantics, custom allocators, or substantially less readable code without approval. - Benchmark noise makes the conclusion unreliable.
Defaults
- Use Criterion for in-process benchmarks when approved or already present.
- Use
hyperfinefor CLI/process startup and end-to-end command benchmarks. - Use
cargo flamegraph, OS profilers, or sampling profilers for CPU hotspots. - Use heap/alloc profiling tools appropriate to the platform when allocation behavior is the metric.
- Use
tokio-console/console-subscriberduring async bottleneck diagnosis when approved. - Benchmark one change at a time and keep inputs representative.
Workflow
- Define metric: latency, throughput, allocations, CPU, memory, binary size, startup, or tail behavior.
- Create or run representative benchmarks and capture baseline.
- Profile to identify bottlenecks instead of guessing.
- Make one focused change.
- Rerun benchmarks enough times to compare reliably.
- Run correctness tests, Clippy, and
just check.
Antipatterns
- Optimizing code outside the measured hot path.
- Adding
unsafefor avoidable zero-copy tricks. - Cloning less by making APIs painful or unsound.
- Unbounded concurrency to improve happy-path throughput.
- Choosing Actix/Fiber-style framework equivalents solely from synthetic benchmark charts.
Completion
Report baseline, profile evidence, measured result, benchmark commands, correctness validation, and tradeoffs.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.