Back to guide/Developer Tools

Performance Code Review

Analyze code for performance issues at the right scale — no micro-optimizations on cold paths.

performancecode-reviewdevelopmentchatgpt
Edit View
Prompt
Analyze this {{language}} code for performance issues:

```
{{paste your code}}
```

Context: This code runs {{frequency}} (e.g., "on every API request", "in a batch job processing 1M records", "on page load").

Check for:
- Unnecessary allocations or copies
- N+1 query patterns
- Missing caching opportunities
- Algorithmic complexity issues (O(n^2) when O(n) is possible)
- Blocking operations that could be async

For each issue, estimate the impact (high/medium/low) and provide an optimized version. Only flag issues that matter at the stated scale — don't micro-optimize code that runs once.

Variables to customize

{{language}}{{paste your code}}{{frequency}}

Why this prompt works

The frequency context prevents ChatGPT from micro-optimizing cold code paths. 'Only flag issues that matter at the stated scale' keeps recommendations practical.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.