# m10-performance

System guidance for agents to optimize Rust code systematically, focusing on profiling and memory allocation control.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3600 installs · ★ 1545
- Author: actionbook
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/actionbook/rust-skills/tree/HEAD/skills/m10-performance/SKILL.md
- Updated: 2026-08-23
- HTML: https://affpapa.org/en/nevibecode/skills/m10-performance

## What it does

The skill provides an agent with an evaluation ladder for Rust performance. It prevents the model from rewriting code blindly and insists on profiling through `perf`, `flamegraph`, or `criterion` first. The assistant learns to attack high-level algorithmic bottlenecks before diving into lower-level micro-optimizations.

Inside, it outlines practical Rust techniques: pre-allocating capacity, moving small collections onto the stack with `SmallVec`, and using references or `Cow` instead of redundant `.clone()` operations. It flags anti-patterns directly, including the use of `LinkedList` or running benchmarks on unoptimized debug builds.

Because the configuration sets `user-invocable: false`, the assistant loads these instructions autonomously when discussing performance or allocations. It offers zero value for non-Rust repositories because every recommendation depends on the Rust standard library and tooling.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m10-performance -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/m10-performance/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/m10-performance/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m10-performance -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/m10-performance/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m10-performance -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/m10-performance/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install actionbook/rust-skills m10-performance
```

2. **Manually: put the files in place**
- File: `.github/skills/m10-performance/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m10-performance -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/actionbook/rust-skills --path skills/m10-performance
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/m10-performance/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add actionbook/rust-skills --skill m10-performance -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/actionbook/rust-skills/tree/HEAD/skills/m10-performance/SKILL.md

## When to use it
- Profile Rust execution hotspots before refactoring algorithms
- Eliminate excessive heap allocations using capacity pre-allocation
- Remove accidental clone operations along critical hot paths
- Configure statistical benchmarks in release mode using criterion

## Example prompts
- This hot loop in Rust is running slowly, help me profile and optimize it
- How can I reduce memory allocations in this parser using SmallVec or Cow?
- Set up a benchmark suite with cargo bench to measure throughput

## Similar
- [go-performance](https://affpapa.org/en/nevibecode/skills/go-performance.md) — skill · 1200 installs
- [rust-profiling](https://affpapa.org/en/nevibecode/skills/rust-profiling.md) — skill · 586 installs
- [V3 Performance Optimization](https://affpapa.org/en/nevibecode/skills/v3-performance-optimization.md) — skill · 1100 installs
- [performance-analysis](https://affpapa.org/en/nevibecode/skills/performance-analysis.md) — skill · 1200 installs
- [game-performance-profiler](https://affpapa.org/en/nevibecode/commands/game-performance-profiler.md) — command · 227 installs
- [js-performance-patterns](https://affpapa.org/en/nevibecode/skills/js-performance-patterns.md) — skill · 687 installs

From the same set: [actionbook/rust-skills](https://affpapa.org/en/nevibecode/by/actionbook/rust-skills.md) — 33 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
