performance-analyzer

Analyze Rust code for memory allocations, CPU cache utilization, and concurrency patterns.

2|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/ahrav/scratch-scanner-rs --skill performance-analyzer-ahrav
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-analyzer
Source: https://github.com/ahrav/scratch-scanner-rs/tree/main/.claude/skills/performance-analyzer
Command: npx skills add https://github.com/ahrav/scratch-scanner-rs --skill performance-analyzer-ahrav

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps identify and fix performance bottlenecks, memory allocation issues, and optimization opportunities within Rust code, ensuring efficient and fast execution.

Core Features & Use Cases

  • Memory & Allocation Analysis: Detects unnecessary allocations, suggests with_capacity, and flags large struct pass-by-value.
  • CPU & Cache Optimization: Identifies cache-unfriendly patterns, suggests inlining, and explores branchless alternatives.
  • Rust-Specific Checks: Reviews bounds checks, iterator usage, and &str vs String implications.
  • Use Case: After implementing a new decoding routine in src/engine/, use this Skill to analyze its performance before benchmarking to catch potential regressions early.

Quick Start

Analyze the performance of the src/engine/decoder.rs file for potential optimizations.

Frequently Asked Questions about performance-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Rust code for memory allocations and CPU cache utilization?

To optimize Rust code, analyze hot-path routines for unnecessary allocations, apply with_capacity, flag large struct pass-by-value, and identify cache-unfriendly patterns to improve execution speed.

What are common performance bottlenecks in Rust decoding routines?

Performance bottlenecks in Rust decoding routines often stem from unnecessary memory allocations, cache-unfriendly access patterns, inefficient iterator usage, and suboptimal bounds checks within hot-path code.

How do I analyze Rust code for performance issues before benchmarking?

Analyze Rust code for performance issues by reviewing memory allocation patterns, checking CPU cache utilization, and evaluating concurrency patterns using detailed checklists before running benchmarks.

Does this Rust optimization approach work for scanning and decoding routines?

Yes, this Rust optimization approach specifically targets performance-critical scanning and decoding routines by identifying optimization opportunities through project-specific pattern recognition and detailed checklists.

What is the best way to reduce memory allocations in Rust hot-path code?

The best way to reduce memory allocations in Rust hot-path code is to detect unnecessary allocations, use with_capacity for collections, avoid large struct pass-by-value, and review String versus str usage.

When should I use branchless alternatives for CPU optimization in Rust?

Use branchless alternatives for CPU optimization in Rust when profiling reveals cache-unfriendly patterns or branch mispredictions in hot-path code, suggesting inlining or branchless logic to improve throughput.