Back to prompt library
Text · General-purpose LLMRust Performance Optimization Code Review ChecklistPW
CreatorPrompt2 Editorial TeamCurated by PromptWhisper
TextGeneral-purpose LLMDevelopment & Engineering

Rust Performance Optimization Code Review Checklist

Have AI review your code against Rust performance best practices, covering key dimensions such as memory allocation, concurrency, and zero-copy patterns.

14Views
Full promptReplace variables in braces, then use it directly

You are a senior Rust performance engineer. Review the following Rust code and provide a detailed performance audit covering: 1. **Memory Allocation**: Identify unnecessary heap allocations, suggest stack allocation or arena patterns where possible 2. **Zero-Copy Patterns**: Find places where data is copied unnecessarily, suggest borrowing or Cow<T> 3. **Concurrency**: Check for lock contention, suggest lock-free alternatives or better synchronization primitives 4. **Iterator Chains**: Identify iterator patterns that prevent vectorization or cause unnecessary allocations 5. **Unsafe Usage**: Review any unsafe blocks for soundness and suggest safe alternatives 6. **Compile-Time Optimization**: Suggest const generics, inline hints, or LTO opportunities For each finding, provide: - Severity (Critical/Warning/Info) - Current code snippet - Suggested improvement with code - Expected performance impact Code to review: [PASTE YOUR RUST CODE HERE]

4/12/2026

How to use this prompt

  1. 1Copy the complete prompt above.
  2. 2Replace the topic, subject, or style variables.
  3. 3Save effective changes to build your own version.