返回提示词库
文本 · 通用大模型Rust 性能优化代码审查清单PW
创作者Prompt2 编辑部PromptWhisper 收录
文本通用大模型开发与工程

Rust 性能优化代码审查清单

让 AI 按照 Rust 性能最佳实践审查你的代码,覆盖内存分配、并发、零拷贝等关键维度

14浏览
完整提示词可替换花括号中的变量后直接使用

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]

2026/4/12

如何使用这条提示词

  1. 1复制上方完整提示词。
  2. 2在对应模型中替换主题、人物或风格变量。
  3. 3生成后记录有效调整,形成自己的版本。