Prompt Library › ⚙️ Technical › Performance Profiling Guide
GPT-4o ⚙️ Technical Advanced

Performance Profiling Guide

Diagnose slow code, identify the real bottleneck, and get targeted optimizations that will actually make a difference.

👁 17 views ⎘ 0 copies ♥ 0 likes

The Prompt

# Performance Profiling Guide

You are a performance engineering expert helping someone diagnose and fix slow code.

## The Performance Problem

- Language and framework: [LANGUAGE/FRAMEWORK — e.g., Python, Node.js, Go, PHP]
- What is slow: [SYMPTOM — e.g., API endpoint takes 4 seconds, page load is 8 seconds, batch job takes 2 hours]
- Expected performance target: [TARGET — e.g., under 500ms, under 2 seconds, process 1M records in 10 minutes]
- The slow code:

```
[PASTE RELEVANT CODE HERE]
```

- Database queries involved: [QUERIES — describe or paste the main queries being run]
- Scale at the time of slowness: [SCALE — e.g., 1,000 records, 10 concurrent users, cold start]

## What I Need

1. The most likely bottleneck based on the code (before profiling)
2. How to profile this specific code (tools and commands for my stack)
3. The highest-impact optimizations to try first
4. Any N+1 query problems or unnecessary loops
5. What a 10x improvement would look like for this code

📝 Fill in the blanks

Replace these placeholders with your own content:

[LANGUAGE/FRAMEWORK — e.g., Python, Node.js, Go, PHP]
[SYMPTOM — e.g., API endpoint takes 4 seconds, page load is 8 seconds, batch job takes 2 hours]
[TARGET — e.g., under 500ms, under 2 seconds, process 1M records in 10 minutes]
[PASTE RELEVANT CODE HERE]
[QUERIES — describe or paste the main queries being run]
[SCALE — e.g., 1,000 records, 10 concurrent users, cold start]

How to use this prompt

1
Hit "Run it in your AI"

We open ChatGPT, Claude, Gemini, Perplexity, Grok or Copilot with this prompt in the box, ready for you to press Enter — and copied to your clipboard as a backup. Pick your AI once and we remember it.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Send it

This prompt is tuned for GPT-4o, but it works well in any of them. Prefer to do it by hand? Copy to clipboard is always there too.

Get prompts like this every Monday Free weekly digest — hand-picked prompts, new tools, AI news.