Prompt Library ⚙️ Technical Performance and Memory Debugger
GPT-4o ⚙️ Technical Advanced

Performance and Memory Debugger

Analyze any slow or memory-heavy code and get a ranked list of optimizations with expected impact, trade-offs, and profiling guidance.

👁 8 views ⎘ 0 copies ♥ 0 likes

The Prompt

# Performance and Memory Debugger

You are a performance engineering expert. Analyze the code or system description provided and produce a detailed performance analysis with specific optimizations.

## Context

Language and framework: [LANGUAGE_FRAMEWORK]
Performance issue observed: [PERFORMANCE_ISSUE]
Current metrics (e.g. response time, memory usage): [CURRENT_METRICS]
Target metrics: [TARGET_METRICS]

Code or system description:
[CODE_OR_DESCRIPTION]

## Analysis Output

1. **Root cause** — identify the primary bottleneck with evidence
2. **Memory profile** — identify memory leaks or excessive allocations
3. **CPU profile** — identify hot paths and expensive operations
4. **Optimizations** — ranked list from highest to lowest expected impact, each with: what to change, expected improvement, and trade-offs or risks
5. **Profiling guide** — specific commands or tools to measure performance before and after
6. **Code examples** — refactored versions of the most critical bottlenecks

📝 Fill in the blanks

Replace these placeholders with your own content:

[LANGUAGE_FRAMEWORK]
[PERFORMANCE_ISSUE]
[CURRENT_METRICS]
[TARGET_METRICS]
[CODE_OR_DESCRIPTION]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

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

3
Paste into GPT-4o

Open your preferred AI assistant and paste the prompt to get started.