skills/pproenca/dot-skills/rust-optimise

rust-optimise

SKILL.md

Rust Optimise Best Practices

Performance optimization guide for Rust applications. Contains 42 rules across 8 categories, prioritized by impact from critical (memory allocation, ownership) to incremental (micro-optimizations).

When to Apply

  • Optimizing Rust code for performance or reducing allocations
  • Choosing data structures for optimal algorithmic complexity
  • Working with iterators to avoid unnecessary intermediate allocations
  • Writing async code with Tokio or other runtimes
  • Profiling hot paths and eliminating performance bottlenecks
  • Reviewing code for performance anti-patterns

Rule Categories by Priority

Priority Category Impact Prefix
1 Memory Allocation CRITICAL mem-
2 Ownership & Borrowing CRITICAL own-
3 Data Structure Selection HIGH ds-
4 Iterator & Collection Patterns HIGH iter-
5 Async & Concurrency MEDIUM-HIGH async-
6 Algorithm Complexity MEDIUM algo-
7 Compile-Time Optimization MEDIUM comp-
8 Micro-optimizations LOW micro-

Quick Reference

1. Memory Allocation (CRITICAL)

2. Ownership & Borrowing (CRITICAL)

3. Data Structure Selection (HIGH)

4. Iterator & Collection Patterns (HIGH)

5. Async & Concurrency (MEDIUM-HIGH)

6. Algorithm Complexity (MEDIUM)

7. Compile-Time Optimization (MEDIUM)

8. Micro-optimizations (LOW)

References

  1. https://nnethercote.github.io/perf-book/
  2. https://rust-lang.github.io/api-guidelines/
  3. https://doc.rust-lang.org/nomicon/
  4. https://tokio.rs/tokio/tutorial

Related Skills

  • For idiomatic patterns, architecture, and code organization, see rust-refactor skill
Weekly Installs
43
GitHub Stars
71
First Seen
Feb 14, 2026
Installed on
codex39
github-copilot38
gemini-cli38
opencode36
kimi-cli36
claude-code35