Analyze and optimize the performance of this [LANGUAGE/FRAMEWORK] code:
[PASTE CODE HERE]
Environment: [WEB APP / API / MOBILE / CLI]
Scale: [REQUESTS PER SECOND / DATA SIZE / USER COUNT]
Provide:
1. **Profiling Analysis**: Where time is being spent, bottleneck identification
2. **Quick Wins**: Optimizations with minimal code changes (with before/after code)
3. **Algorithmic Improvements**: Better data structures or algorithms
4. **Caching Strategy**: What to cache, where (in-memory, Redis, CDN), cache invalidation
5. **Database Optimizations**: Query optimization, indexing, connection pooling
6. **Async/Parallel**: What can be parallelized or made non-blocking
7. **Memory Optimization**: Reducing allocations, fixing leaks
8. **Benchmarks**: How to measure the improvements
9. **Estimated Impact**: Expected performance gain for each optimization
Analyze and optimize the performance of this [LANGUAGE/FRAMEWORK] code:
[PASTE CODE HERE]
Environment: [WEB APP / API / MOBILE / CLI]
Scale: [REQUESTS PER SECOND / DATA SIZE / USER COUNT]
Provide:
1. **Profiling Analysis**: Where time is being spent, bottleneck identification
2. **Quick Wins**: Optimizations with minimal code changes (with before/after code)
3. **Algorithmic Improvements**: Better data structures or algorithms
4. **Caching Strategy**: What to cache, where (in-memory, Redis, CDN), cache invalidation
5. **Database Optimizations**: Query optimization, indexing, connection pooling
6. **Async/Parallel**: What can be parallelized or made non-blocking
7. **Memory Optimization**: Reducing allocations, fixing leaks
8. **Benchmarks**: How to measure the improvements
9. **Estimated Impact**: Expected performance gain for each optimization
How to use this prompt
Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.
Leave a Review
Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.