Skip to content
Promptnic
#95 overall#15 in Coding & DevBeginnerChain-of-Thought

Performance Detective

Finds the real bottleneck in slow code or queries, estimates impact and proposes fixes ranked by effort.

Open in:ChatGPTClaudeGrokPerplexity

The prompt

You are a performance engineer. This [CODE_OR_QUERY_TYPE] is slow: [SYMPTOM_AND_NUMBERS] Analyse it: 1. Estimate time complexity and identify the hot path. 2. List likely bottlenecks (N+1 queries, missing indexes, repeated work, blocking I/O, memory churn), with evidence from the code. 3. Propose fixes in a table: fix, expected speed-up (rough), effort (S/M/L), risk. 4. Tell me exactly what to measure to confirm the top suspect before I change anything. Code/query and any profiler output: [CODE_AND_PROFILE]

Fill in the variables

The prompt above updates live. Nothing leaves your browser.

Remix it

One-click variations. Stack them, then copy.

Open in Prompt Lab →

Why this prompt works

It refuses to optimise blind: the "measure first" step keeps you from rewriting code that was never the bottleneck. The effort-and-risk table turns analysis into a prioritised backlog.

Framework: Chain-of-Thought. Asks the model to reason through explicit steps before answering.

Example

Illustrative, not a real model output

Example input

[CODE_OR_QUERY_TYPE]
Django view
[SYMPTOM_AND_NUMBERS]
order list page takes 4.2 s with 500 orders
[CODE_AND_PROFILE]
for o in Order.objects.all(): o.customer.name ...

What a good answer looks like (abridged)

Hot path: one customer query per order (N+1): ~501 queries. | select_related("customer") | 10-30x | S | low | Measure: enable django-debug-toolbar and confirm the query count before changing.

How to use it

  1. Fill in 3 variables below (or in the prompt) with specific details.
  2. Paste it into DeepSeek (also works in ChatGPT, Claude, Gemini).
  3. Check the result against the prompt’s rules and ask for a revision where it falls short.

DeepSeek tips

  • Reasoning models do best with a clear goal and constraints; skip “think step by step”, they already do.
  • Ask for the final answer in a fixed format so it is easy to scan after the reasoning.

Common mistakes

  • Leaving [VARIABLES] unfilled or vague ("my business") instead of specific ("a 3-person Calgary bakery").
  • Deleting the constraints to make the prompt shorter; they are what prevent generic output.
  • Accepting the first answer. Reply with what to fix and ask for a revision.

Guide: Promptnic template.

Frequently asked questions

Which AI model works best with the Performance Detective prompt?+

It is tuned for DeepSeek and also works in ChatGPT, Claude, Gemini, Grok. Reasoning models do best with a clear goal and constraints; skip “think step by step”, they already do.

How do I use this prompt?+

Copy it, replace the 3 [VARIABLES] (code or query type, symptom and numbers, code and profile) with your details, then paste it into DeepSeek. You can fill the variables on this page and copy the finished version.

Is this prompt free to use?+

Yes. Every prompt on Promptnic is free to copy, adapt and use in personal or commercial work. A link back is appreciated, not required.

Why does this prompt work?+

It refuses to optimise blind: the "measure first" step keeps you from rewriting code that was never the bottleneck. The effort-and-risk table turns analysis into a prioritised backlog.

Related prompts