Rust Performance

Performance optimization expert covering profiling, benchmarking, memory allocation, SIMD, cache optimization, false sharing, lock contention, and NUMA-aware programming.

49 stars 7 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add huiali/rust-skills --skill rust-performance
Manual install
git clone --depth 1 https://github.com/huiali/rust-skills.git /tmp/rust-skills
mkdir -p ~/.claude/skills
cp -r /tmp/rust-skills/.codex/skills/rust-performance ~/.claude/skills/rust-performance

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

## Optimization Priority

```
1. Algorithm choice      (10x - 1000x)   ← Biggest impact
2. Data structure        (2x - 10x)
3. Reduce allocations    (2x - 5x)
4. Cache optimization    (1.5x - 3x)
5. SIMD/parallelism      (2x - 8x)
```

**Warning**: Premature optimization is the root of all evil. Make it work first, then optimize hot paths.

## Solution Patterns

### Pattern 1: Pre-allocation

```rust
// ❌ Bad: grows dynamically
let mut vec = Vec::new();
for i in 0..1000 {
    vec.push(i);
}

// ✅ Good: pre-allocate known size
let mut vec = Vec::with_capacity(1000);
for i in 0..1000 {
    vec.push(i);
}
```

### Pattern 2: Avoid Unnecessary Clones

```rust
// ❌ Bad: unnecessary clone
fn process(item: &Item) {
    let data = item.data.clone();
    // use data...
}

// ✅ Good: use reference
fn process(item: &Item) {
    let data = &item.data;
    // use data...
}
```

### Pattern 3: Batch Operations

```rust
// ❌ Bad: multiple database calls
for user_id in user_ids {
    db.update(user_id, status)?;
}

// ✅ Good: batch update
db.update_all(user_ids, status)?;
```

### Pattern 4: Small Object Optimization

```rust
use smallvec::SmallVec;

// ✅ No heap allocation for ≤16 items
let mut vec: SmallVec<[u8; 16]> = SmallVec::new();
```

### Pattern 5: Parallel Processing

```rust
use rayon::prelude::*;

let sum: i32 = data
    .par_iter()
    .map(|x| expensive_computation(x))
    .sum();
```

## Profiling Tools

| Tool | Purpose |
|------|---------|
Read the full skill on GitHub

Details

Skill name
rust-performance
Path
.codex/skills/rust-performance/SKILL.md
License
MIT
Repo updated
9 February 2026

FAQ

What does the Rust Performance skill do?

Performance optimization expert covering profiling, benchmarking, memory allocation, SIMD, cache optimization, false sharing, lock contention, and NUMA-aware programming.

How do I install the Rust Performance skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add huiali/rust-skills --skill rust-performance. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Rust Performance popular?

It lives in huiali/rust-skills, which has 49 GitHub stars and 7 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.