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.
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
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.
Related prompts
Get thorough code reviews with actionable feedback tailored to your language, framework, and standards.
Context-Aware Code CompletionProviding the surrounding code and project context lets the model match existing patterns exactly. The constraint against modifying existing code prevents unwanted side effects.
Inline Code SuggestionConstraining suggestions to match existing style and scope produces insertions that feel native to the codebase. The 'no explanation' rule mimics real inline completion behavior.
Code ExplanationThe audience level parameter adjusts complexity automatically. Requiring a usage example ensures the explanation is practical, not just theoretical.