Back to guide/Developer Tools

Performance Optimization Audit

Both editors can read component code and identify performance patterns. The 'don't suggest micro-optimizations' instruction keeps the output actionable. The categorized checklist ensures nothing major is missed.

cursor-vs-windsurffile_or_component_pathcomponent_typewhat_it_does
Edit View
Prompt
Audit {{file_or_component_path}} for performance issues.

Context: This is a {{component_type}} that {{what_it_does}}. Users report it feels {{performance_complaint}}.

Check for:

**React-specific** (if applicable):
- Unnecessary re-renders: missing memo, useMemo, useCallback
- State updates that could be batched
- Components that should be lazy-loaded
- Large lists missing virtualization

**Data fetching**:
- Waterfall requests that could be parallel
- Missing caching / stale-while-revalidate
- Over-fetching (fetching more data than displayed)
- N+1 query patterns

**Bundle**:
- Large imports that could be tree-shaken or dynamically imported
- Dependencies with smaller alternatives

**Runtime**:
- Expensive computations on every render
- DOM measurements forcing layout thrashing
- Animation jank (layout properties instead of transform/opacity)

For each issue:
- Impact: High / Medium / Low
- Current code snippet
- Optimized code snippet
- Estimated improvement (be specific: "reduces re-renders from N to 1" or "cuts bundle by ~40KB")

Prioritize by impact. Don't suggest micro-optimizations that save less than 1ms.

Variables to customize

{{file_or_component_path}}{{component_type}}{{what_it_does}}{{performance_complaint}}

Why this prompt works

Both editors can read component code and identify performance patterns. The 'don't suggest micro-optimizations' instruction keeps the output actionable. The categorized checklist ensures nothing major is missed.

Save this prompt to your library

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