Back to prompts
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