DEVELOPMENT WORKBOOK
Performance optimisation prompts
Work through 14 performance optimisation tasks. Open a brief to see its worked example, customise the variables and copy the completed prompt.
← All categoriesContain a large roster DOM Intermediate
Limit rendered rows while preserving keyboard navigation.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Limit rendered rows while preserving keyboard navigation.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The experiment checks DOM size and whether a keyboard user reaches the final pupil.
Worked example
Input: school directory has 8000 pupils. Passing result: The experiment checks DOM size and whether a keyboard user reaches the final pupil.
Common mistakes
- Treating the normal path as sufficient without checking this case: school directory has 8000 pupils.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The experiment checks DOM size and whether a keyboard user reaches the final pupil.
- For “Contain a large roster DOM”, show the smallest evidence a second reviewer would need before sign-off.
Reduce image decode cost Intermediate
Choose responsive dimensions based on rendered size.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Choose responsive dimensions based on rendered size.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The comparison records bytes and decode time for an appropriately sized thumbnail.
Worked example
Input: thumbnail renders at 160px but source is 4000px. Passing result: The comparison records bytes and decode time for an appropriately sized thumbnail.
Common mistakes
- Treating the normal path as sufficient without checking this case: thumbnail renders at 160px but source is 4000px.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The comparison records bytes and decode time for an appropriately sized thumbnail.
- For “Reduce image decode cost”, show the smallest evidence a second reviewer would need before sign-off.
Trim startup translation bundles Intermediate
Load only the active locale before first interaction.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Load only the active locale before first interaction.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The baseline compares transferred locale bytes before and after splitting.
Worked example
Input: app downloads twelve locales on launch. Passing result: The baseline compares transferred locale bytes before and after splitting.
Common mistakes
- Treating the normal path as sufficient without checking this case: app downloads twelve locales on launch.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The baseline compares transferred locale bytes before and after splitting.
- For “Trim startup translation bundles”, show the smallest evidence a second reviewer would need before sign-off.
Defer a below-fold map Intermediate
Keep initial contact information usable without fetching map code.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Keep initial contact information usable without fetching map code.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The page displays contact details before any map request.
Worked example
Input: map sits below address and opening hours. Passing result: The page displays contact details before any map request.
Common mistakes
- Treating the normal path as sufficient without checking this case: map sits below address and opening hours.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The page displays contact details before any map request.
- For “Defer a below-fold map”, show the smallest evidence a second reviewer would need before sign-off.
Bound an autocomplete cache Intermediate
Trade hit rate against retained memory.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Trade hit rate against retained memory.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The experiment sets an entry limit and measures evictions and hit rate.
Worked example
Input: district searches accumulate for an entire session. Passing result: The experiment sets an entry limit and measures evictions and hit rate.
Common mistakes
- Treating the normal path as sufficient without checking this case: district searches accumulate for an entire session.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The experiment sets an entry limit and measures evictions and hit rate.
- For “Bound an autocomplete cache”, show the smallest evidence a second reviewer would need before sign-off.
Measure a slow print preview Intermediate
Separate document construction time from print rendering.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Separate document construction time from print rendering.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. Two timestamps isolate data preparation from preview rendering.
Worked example
Input: 300-line invoice prints after a long pause. Passing result: Two timestamps isolate data preparation from preview rendering.
Common mistakes
- Treating the normal path as sufficient without checking this case: 300-line invoice prints after a long pause.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: Two timestamps isolate data preparation from preview rendering.
- For “Measure a slow print preview”, show the smallest evidence a second reviewer would need before sign-off.
Batch dashboard redraws Intermediate
Coalesce frequent updates without concealing final values.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Coalesce frequent updates without concealing final values.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The display renders one coherent frame with the latest values.
Worked example
Input: ten meter readings arrive together. Passing result: The display renders one coherent frame with the latest values.
Common mistakes
- Treating the normal path as sufficient without checking this case: ten meter readings arrive together.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The display renders one coherent frame with the latest values.
- For “Batch dashboard redraws”, show the smallest evidence a second reviewer would need before sign-off.
Avoid repeated count queries Intermediate
Replace per-category queries with an aggregated read.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Replace per-category queries with an aggregated read.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. A trace reports fewer database calls with unchanged counts.
Worked example
Input: directory displays counts for 40 subjects. Passing result: A trace reports fewer database calls with unchanged counts.
Common mistakes
- Treating the normal path as sufficient without checking this case: directory displays counts for 40 subjects.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: A trace reports fewer database calls with unchanged counts.
- For “Avoid repeated count queries”, show the smallest evidence a second reviewer would need before sign-off.
Address layout shift in notices Intermediate
Reserve stable space for late-arriving notices.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Reserve stable space for late-arriving notices.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The trial tracks layout shift and confirms the button remains stable.
Worked example
Input: banner pushes a submit button under the pointer. Passing result: The trial tracks layout shift and confirms the button remains stable.
Common mistakes
- Treating the normal path as sufficient without checking this case: banner pushes a submit button under the pointer.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The trial tracks layout shift and confirms the button remains stable.
- For “Address layout shift in notices”, show the smallest evidence a second reviewer would need before sign-off.
Shrink offline precache scope Intermediate
Cache essential lessons without downloading every video.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Cache essential lessons without downloading every video.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The proposed pack keeps text lessons available within a named byte budget.
Worked example
Input: initial offline pack includes the video archive. Passing result: The proposed pack keeps text lessons available within a named byte budget.
Common mistakes
- Treating the normal path as sufficient without checking this case: initial offline pack includes the video archive.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The proposed pack keeps text lessons available within a named byte budget.
- For “Shrink offline precache scope”, show the smallest evidence a second reviewer would need before sign-off.
Measure cold versus warm startup Intermediate
Separate first visit performance from repeat visits.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Separate first visit performance from repeat visits.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The report presents separate cold and warm distributions.
Worked example
Input: first launch slow but repeat load fast. Passing result: The report presents separate cold and warm distributions.
Common mistakes
- Treating the normal path as sufficient without checking this case: first launch slow but repeat load fast.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The report presents separate cold and warm distributions.
- For “Measure cold versus warm startup”, show the smallest evidence a second reviewer would need before sign-off.
Triage scroll handler work Intermediate
Keep scrolling smooth without losing visible state.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Keep scrolling smooth without losing visible state.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The trace attributes long frames and compares a bounded update schedule.
Worked example
Input: a sticky header recalculates size on every scroll. Passing result: The trace attributes long frames and compares a bounded update schedule.
Common mistakes
- Treating the normal path as sufficient without checking this case: a sticky header recalculates size on every scroll.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The trace attributes long frames and compares a bounded update schedule.
- For “Triage scroll handler work”, show the smallest evidence a second reviewer would need before sign-off.
Optimise a CSV export stream Intermediate
Limit peak memory by emitting rows incrementally.
Recommended tools: OpenAI Codex or Claude Code
Complete prompt
Design a measured improvement for the stated bottleneck for {{project}}. Limit peak memory by emitting rows incrementally.
Use this case: {{scenario}}. Clarify any missing policy before choosing defaults. Deliver a baseline protocol, proposed change and regression budget. Use representative devices and distinguish measured numbers from targets.
Acceptance criterion: {{criterion}} Explain how a reviewer can independently check it.Expected output
A baseline protocol, proposed change and regression budget. The report compares peak memory and verifies the final row still appears.
Worked example
Input: export grows from 500 to 50000 records. Passing result: The report compares peak memory and verifies the final row still appears.
Common mistakes
- Treating the normal path as sufficient without checking this case: export grows from 500 to 50000 records.
- Reporting a pass without evidence for the acceptance criterion.
Follow-up prompts
- Construct a contrasting case in which this result should not hold: The report compares peak memory and verifies the final row still appears.
- For “Optimise a CSV export stream”, show the smallest evidence a second reviewer would need before sign-off.