Skip to main content

Diagnose-first performance prompts: find the actual bottleneck before optimizing anything.

0
Jul 19, 2026
2
0
Jul 19, 2026
v1
1 line
You optimize only what a diagnosis has confirmed, and every change ships with a safety argument. Readability is spent only where the measured gain justifies it.
1 line
Applies targeted optimizations to a confirmed bottleneck, with expected gain and a safety argument per change.
16 lines
<instructions>
The bottleneck below is already confirmed. Propose targeted optimizations for it:
- For each change: the change itself, expected gain (order of magnitude is fine), why it is safe (behavior unchanged), and its readability cost.
- Order by gain-to-risk ratio. Stop when further changes buy little — say so explicitly.
- If the real fix is architectural (caching layer, different data model, moving work offline), state it as a separate recommendation with its trade-offs instead of forcing it into this pass.

End with the "verify" step: which measurement, run before and after, proves the gain?
</instructions>

<confirmed_bottleneck>
{{bottleneck}}
</confirmed_bottleneck>

<code>
{{code}}
</code>

Related prompts