
M10 Performance
The m10-performance skill guides developers through systematic performance optimization by establishing whether optimization is necessary before implementing solutions. It maps performance goals—such as reducing allocations, improving cache efficiency, and parallelizing workloads—to specific design choices and implementation techniques in Rust, while emphasizing measurement through profiling and benchmarking tools like criterion and flamegraph. The skill traces constraints from business requirements down to low-level implementation decisions, helping developers identify actual bottlenecks and understand the complexity-versus-speed trade-offs involved in optimization.
- skills.sh installs
- 895
- GitHub stars
- 1.3K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add zhanghandong/rust-skills --skill m10-performance --agent claude-codeInstalls into .claude/skills of the current project.
Files
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 |
|---|---|---|
| Reduce allocations | Pre-allocate, reuse | with_capacity, object pools |
| Improve cache | Contiguous data | Vec, SmallVec |
| Parallelize | Data parallelism | rayon, threads |
| Avoid copies | Zero-copy | References, Cow<T> |
| Reduce indirection | Inline data | smallvec, arrays |
Thinking Prompt
Before optimizing:
-
Have you measured?
- Profile first → flamegraph, perf
- Benchmark → criterion, cargo bench
- Identify actual hotspots
-
What's the priority?
- Algorithm (10x-1000x improvement)
- Data structure (2x-10x)
- Allocation (2x-5x)
- Cache (1.5x-3x)
-
What's the trade-off?
- Complexity vs speed
- Memory vs CPU
- Latency vs throughput
Trace Up ↑
To domain constraints (Layer 3):
Sponsors
Details
- Repository
- github.com/zhanghandong/rust-skills
- Categories
- Debugging, Rust
More from zhanghandong/rust-skills
All 34- M07 Concurrency844
- M06 Error Handling827
- Rust Refactor Helper821
- M01 Ownership809
- M04 Zero Cost789
- M05 Type Driven786
- M02 Resource783
- M03 Mutability773
- M12 Lifecycle764
- M14 Mental Model751
- M09 Domain750
- M11 Ecosystem747
- M13 Domain Error738
- Rust Trait Explorer731
- Rust Code Navigator728
- Unsafe Checker726
- Domain Cli709
- Rust Symbol Analyzer702
- Rust Call Graph699
- Rust Router698
- Rust Learner688
- Rust Deps Visualizer684
- Rust Skill Creator670
- Domain Web648