Performance Review of a Diff
Identification of hot paths, allocations and query patterns in a diff that are worth changing.
Advanced · Works with ChatGPT, Claude, Gemini, Copilot
The prompt
Review this diff for performance: hot paths, unnecessary allocations, and query patterns worth changing.
Keep the tone direct with no hedging, and if the diff is genuinely fine on performance, say so instead of inventing feedback.
Diff to review:
{{CODE}}
Expected load or scale:
{{STACK}}Why this prompt works
Explicitly permitting 'this is fine' stops the review from inflating minor stylistic choices into performance issues.
How to customize it
- Benchmark the flagged hot path before and after any suggested change.
- Skip micro-optimizations on code that only runs at startup or rarely.
Common mistakes
- Asking for a performance review on code with no load context, producing generic advice.
- Chasing N+1 queries that don't matter at the stated scale.
Example
Input
Diff to review: New function that fetches a user's orders and enriches each with product data
What a good answer looks like
Either a short list of concrete performance issues with fixes, or a note that it's fine.
Make this prompt fit your work
ModelCoach.ai scores your version, shows what to improve and explains why, right inside ChatGPT, Claude, Gemini and Copilot.