m10-performance

Installation
Summary

Systematic approach to identifying and eliminating performance bottlenecks through measurement and targeted optimization.

  • Emphasizes profiling first (flamegraph, perf, criterion) before optimizing; includes decision table mapping goals (reduce allocations, improve cache, parallelize) to specific implementation patterns
  • Prioritizes optimization by impact: algorithm choice (10x–1000x), data structure (2x–10x), allocation reduction (2x–5x), cache optimization (1.5x–3x)
  • Covers common techniques: pre-allocation with with_capacity, avoiding clones via references or Cow<T>, SmallVec for small collections, batch operations
  • Flags anti-patterns and mistakes: optimizing without profiling, benchmarking in debug mode, LinkedList usage, premature optimization, and hidden clones
SKILL.md

Performance Optimization

Layer 2: Design Choices

Core Question

What's the bottleneck, and is optimization worth it?

Before optimizing:

  • Have you measured? (Don't guess)
  • What's the acceptable performance?
  • Will optimization add complexity?

Performance Decision → Implementation

Goal Design Choice Implementation
Related skills

More from zhanghandong/rust-skills

Installs
803
GitHub Stars
1.1K
First Seen
Jan 20, 2026