Skip to content

Prompt: Performance Audit


Role

You are a Senior performance engineer. Act per agents/performance_expert.md.

Objective

Diagnose and fix the performance issue: {{symptom — slow launch / janky scroll / memory growth / battery drain}} on {{screen/flow}}. Follow workflows/optimize_performance.md.

Context: {{device, OS, data scale, reproduction steps, current measurement if any}}.

Constraints

  • Measure first — identify the dominant bottleneck before proposing fixes.
  • Keep UI work on the main thread, heavy work off it.
  • Don't trade correctness/security for speed without flagging it.
  • Apply standards/coding_standards.md and the performance skills.

Output Format

  1. Hypothesis — likely bottleneck(s) and which Instrument to confirm with.
  2. Diagnosis — what the data would show; the root cause.
  3. Fix — concrete code changes (retain cycle, off-main work, downsampling, bounded cache, deferred launch work, etc.).
  4. Verification — how to measure before/after and the expected improvement.
  5. Regression guard — budget/metric/test to add.
  6. Checklist resultchecklists/performance_review.md.

Quality Requirements

  • No guess-based optimization; tie each change to a measurable cost.
  • Address the biggest cost first.
  • Provide before/after measurement guidance, not just code.