Debug a Performance Problem

Find the N+1s, blocking calls, and hot loops, ranked by impact-per-effort.

Advanced1 min read

Customize

Fill these in and the prompt below updates as you type. Anything you leave blank stays as a placeholder.

Your prompt

6 placeholders left
My {{stack}} application is slow. Here's what I know:

What's slow: {{slow_operation}}
How slow: {{current_latency}}
Expected: {{target_latency}}
Scale: {{scale}}

Relevant code:
{{code}}

Analyze: what's the time complexity of this code? Where are the likely bottlenecks (N+1 queries, unnecessary loops, blocking calls, memory allocation)?

Suggest fixes ranked by impact: highest-impact/lowest-effort first. For each fix, estimate the expected improvement and explain why.

Similar prompts

Add Diagnostics Before Guessing

Instrument first, theorize second — logging with a stated plan for capturing the failure.

Bisect a Regression

Walk the history between a known-good commit and main to find the culprit diff.

Fix a Bug Without Breaking Things

Find every affected code path and the same bug elsewhere before landing the minimal fix.

Optimize a Slow Query

Read the execution plan, name the real bottleneck, and get a rewrite plus the exact index to add.