Performance work: measure before optimizing
Give the measurement method and the most likely hotspots
Prompt
Copy it whole, then replace the brackets with your own contentHandle this coding task: Performance: Measure, Then Optimize. Code/error: [paste] Environment: [language/version/framework] Requirements: Give the measurement method and the most likely hotspots. Give your assessment first, then the changes, then how to verify.
Replace the text in [ ] with your own situation; ask long tasks in stages.
How to get better results
Read this before you fill it inUse when the page lags or the API is slow but you don't know the bottleneck.
Give the conclusion and impact scope first, then only the changed snippets (no full files), and finally one check that proves it works. Flag risky spots separately.
List-page first screen is 4.2s, API 800ms, no idea where the rest of the time goes. Stack: Vue3 + Laravel.
Just saying "optimize performance" with no measurement method Not separating network, rendering and API Changing many places at once, can't tell what helped
If problems remain after the fix, paste the new error and the changed snippet back; keep debugging on the original approach, don't switch approaches and rewrite.
More like this: Writing code prompts · All prompts