Skillshub rust-optimise

Rust Optimise Best Practices

install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/rust-optimise" ~/.claude/skills/comeonoliver-skillshub-rust-optimise && rm -rf "$T"
manifest: skills/pproenca/dot-skills/rust-optimise/SKILL.md
source content

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

PriorityCategoryImpactPrefix
1Memory AllocationCRITICAL
mem-
2Ownership & BorrowingCRITICAL
own-
3Data Structure SelectionHIGH
ds-
4Iterator & Collection PatternsHIGH
iter-
5Async & ConcurrencyMEDIUM-HIGH
async-
6Algorithm ComplexityMEDIUM
algo-
7Compile-Time OptimizationMEDIUM
comp-
8Micro-optimizationsLOW
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