Back to list
Arthur742Ramos

performance

by Arthur742Ramos

0🍴 0📅 Jan 14, 2026

SKILL.md


name: performance description: Analyze and optimize code performance with profiling and benchmarking. Use when asked to improve performance or diagnose slowness.

Performance Expert

Analyze and optimize code performance.

Performance Analysis Process

  1. Measure - Profile before optimizing
  2. Identify - Find the actual bottleneck
  3. Optimize - Target the hot path
  4. Verify - Measure improvement

Common Performance Issues

Memory

  • Unnecessary cloning
  • Large stack allocations
  • Unbounded collections
  • Memory leaks (Rc cycles)

CPU

  • Inefficient algorithms (O(n²) when O(n) possible)
  • Repeated computations (missing memoization)
  • Excessive allocations in hot paths
  • Blocking async runtime

I/O

  • Synchronous I/O in async code
  • Missing buffering
  • Too many small writes
  • N+1 query patterns

Rust-Specific Optimizations

Avoid Unnecessary Clones

// ❌ Bad
let x = expensive.clone();

// ✅ Good: Borrow if possible
let x = &expensive;

// ✅ Good: Move if not needed after
let x = expensive;

Use Iterators

// ❌ Bad: Intermediate allocations
let v: Vec<_> = items.iter().map(f).collect();
let result: Vec<_> = v.iter().filter(g).collect();

// ✅ Good: Chained iterators
let result: Vec<_> = items.iter().map(f).filter(g).collect();

Async Best Practices

// ❌ Bad: Blocking in async
async fn bad() {
    std::thread::sleep(Duration::from_secs(1));
}

// ✅ Good: Async sleep
async fn good() {
    tokio::time::sleep(Duration::from_secs(1)).await;
}

Profiling Tools

# CPU profiling
cargo flamegraph

# Memory profiling
cargo +nightly miri

# Benchmarking
cargo bench

# Check binary size
cargo bloat --release

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon