DigiTransact · Vibe Coding Academy

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 categories
Contain 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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt
Prevent hidden-tab polling waste Intermediate

Suspend nonessential polling until the page becomes visible.

Recommended tools: OpenAI Codex or Claude Code

Complete prompt

Design a measured improvement for the stated bottleneck for {{project}}. Suspend nonessential polling until the page becomes visible.

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 counts background requests and checks immediate refresh on return.

Worked example

Input: dashboard left in a background tab.
Passing result: The experiment counts background requests and checks immediate refresh on return.

Common mistakes

Follow-up prompts

Link to this prompt
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

Follow-up prompts

Link to this prompt