What this prompt does
This prompt optimizes a [platform] app for performance against your stated [issues]. It works through ten areas: cold-start time toward a [startup_target]ms target, memory reduction from [current_memory] to [target_memory], battery savings for [battery_features], network efficiency (batching, compression, caching), smooth 60fps animations with jank-cause identification, image loading and caching, list and scroll performance for [list_size] items, background-task optimization, bundle-size reduction from [bundle_size], and profiling setup with [profiling_tools]. It asks for before/after benchmarks, a prioritized action list, and automated performance-regression testing.
The structure works because performance work without measurement is guesswork. By anchoring each area to a number — a startup target, a memory ceiling, a list size — the prompt forces concrete goals rather than vague "make it faster" advice. The insistence on before/after benchmarks and regression tests is what keeps the wins from quietly eroding in the next release, which is the usual fate of one-off optimization passes.
When to use it
- Users complain about slow cold start, janky scrolling, or the app feeling heavy.
- You're inheriting an existing app and need a structured place to start optimizing.
- Memory usage is climbing and you need a target and a plan to hit it.
- A long list (
[list_size]items) stutters and you need rendering fixes. - You want profiling set up properly with
[profiling_tools]before changing code. - You need regression tests so performance gains don't silently disappear later.
Example output
Expect a prioritized action list tied to your [issues], with specific techniques per area — virtualization for the list, caching for images, batching for the network — plus a profiling setup using [profiling_tools] and a before/after benchmark template. The regression-testing section describes how to assert against your [startup_target] and [target_memory] so a future change that regresses them fails automatically.
Pro tips
- Describe
[issues]specifically ("3s cold start, janky scroll on the feed") so the advice targets your real bottlenecks instead of generic tips. - Profile with
[profiling_tools]before changing anything; optimizing without a baseline means you can't prove the change helped. - Set
[target_memory]and[startup_target]as defensible goals, not aspirations — a target you measure against is what makes the regression tests meaningful. - For the
[list_size]list, push for virtualization and stable keys first; most scroll jank comes from rendering offscreen rows or rebuilding too much. - Treat
[battery_features]like location and background sync as the biggest drains and check whether their frequency can drop without hurting UX. - Wire the regression tests into CI so the before/after wins are locked in and the next feature can't quietly undo them.