Back to prompts
Coding & DevelopmentPremiumadvanced
0.0

Find the Bottleneck — Performance Profiling Without Tools

AI analyzes your code and pinpoints exactly where it's slow, with before/after optimizations that show measurable improvements.

Copy & Paste this prompt
You are a performance optimization specialist who has sped up applications handling millions of requests. You don't guess — you analyze systematically.

Profile this code for performance issues.

Code: [PASTE YOUR CODE]
Language: [LANGUAGE/FRAMEWORK]
Scale: [HOW MANY USERS / REQUESTS / DATA SIZE?]
Current symptom: [WHAT'S SLOW? PAGE LOAD? API RESPONSE? DATABASE QUERY? MEMORY?]

Perform a systematic performance analysis:

1. HOTSPOT MAP — Identify the top 3-5 performance bottlenecks, ranked by impact:
   For each: Location → Why it's slow → Estimated impact (% of total latency)

2. COMPLEXITY ANALYSIS — What's the Big-O of the critical paths? Where does it degrade at scale?

3. QUICK WINS — Changes that take <30 minutes but improve performance significantly:
   Show exact before/after code with expected improvement

4. ARCHITECTURAL FIXES — Deeper changes that require more work but have bigger impact:
   - Caching strategies (what to cache, TTL, invalidation)
   - Query optimization (indexes, query rewriting)
   - Async/parallel opportunities
   - Data structure changes

5. MEMORY ANALYSIS — Any memory leaks, unnecessary allocations, or objects that should be pooled?

6. BENCHMARK TEMPLATE — Give me a simple benchmark script I can run to measure the before/after difference

7. MONITORING CHECKLIST — What metrics should I track to catch future performance regressions?
#performance#optimization#profiling#bottleneck#speed

Works with

chatgptclaudecopilot

💡 Pro Tips

  • Always profile BEFORE optimizing — don't guess where the bottleneck is
  • The N+1 query problem is the #1 cause of slow APIs in 80% of apps
  • Focus on the biggest bottleneck first — fixing a 5% issue is wasted effort

✨ Example Output

HOTSPOT #1: Database N+1 query in getUserOrders() — Line 34
IMPACT: ~70% of total response time
You're running 1 query per order inside a loop. With 50 orders, that's 51 DB calls.

QUICK WIN (5 min):
BEFORE: orders.forEach(o => db.query('SELECT * FROM items WHERE order_id = ?', o.id))
AFTER: db.query('SELECT * FROM items WHERE order_id IN (?)', orderIds)
Expected improvement: 200ms → 15ms

🧠 Why This Works

Performance issues are rarely where you think they are. This prompt applies profiling methodology—measure first, optimize second—to pinpoint the actual bottleneck rather than wasting time optimizing code that isn't the problem.

📅 When to Use This Prompt

Use when your application is slow and you need to find out exactly where time is being spent, when you need before/after metrics to justify optimization work, or when investigating latency spikes in production.

🎯 What You'll Get

You'll receive a profiling strategy with specific tools and commands for your stack, interpretation of profiling output identifying the top bottlenecks, targeted optimizations with expected improvement percentages, and verification steps to confirm the fix.

🔗 Related Prompts

Coding & DevelopmentPremium

Application Performance Profiler

Profile and optimize application performance bottlenecks with a prioritized optimization plan.

performanceoptimizationprofiling
4.7
advanced
Coding & DevelopmentPremium

System Design Interview Simulator

Practice system design interviews with a realistic AI interviewer — get architecture feedback, follow-up questions, and…

system-designinterviewarchitecture
4.9
advanced
Coding & DevelopmentPremium

CI/CD Pipeline Architect

Design a complete CI/CD pipeline — build, test, deploy, monitor — with config files ready to use.

ci-cddevopsgithub-actions
4.8
advanced