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-code

Installs 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

GoalDesign ChoiceImplementation
Reduce allocationsPre-allocate, reusewith_capacity, object pools
Improve cacheContiguous dataVec, SmallVec
ParallelizeData parallelismrayon, threads
Avoid copiesZero-copyReferences, Cow<T>
Reduce indirectionInline datasmallvec, arrays

Thinking Prompt

Before optimizing:

  1. Have you measured?

    • Profile first → flamegraph, perf
    • Benchmark → criterion, cargo bench
    • Identify actual hotspots
  2. What's the priority?

    • Algorithm (10x-1000x improvement)
    • Data structure (2x-10x)
    • Allocation (2x-5x)
    • Cache (1.5x-3x)
  3. 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

Recommended

More Debugging
1hamelsmu avatarerror-analysishamelsmu/evals-skillsHelp the user systematically identify and categorize failure modes in an LLM pipeline by reading traces. Use when starting a new eval project, after significant799skills.sh installs
2patternsdev avatarjs-performance-patternspatternsdev/skillsProvides framework-agnostic JavaScript runtime performance patterns. Use when optimizing hot paths, loops, DOM operations, caching, or data structure choices in706skills.sh installs
3theodo-group avatardbgtheodo-group/debug-thatDebug applications using the dbg CLI debugger. Supports Node.js (V8/CDP), Bun (WebKit/JSC), Python (debugpy/DAP), Java (JDWP/DAP), and native code via LLDB (DAP673skills.sh installs
4charon-fan avatarperformance-engineercharon-fan/agent-playbookperformance engineer629skills.sh installs
5copilotkit avatarcopilotkit-debugcopilotkit/skillscopilotkit debug618skills.sh installs
6mohitmishra786 avatarrust-debuggingmohitmishra786/low-level-dev-skillsRust debugging skill for systems programming. Use when debugging Rust binaries with GDB or LLDB, enabling Rust pretty-printers, interpreting panics and backtrac597skills.sh installs