891 B
891 B
Analyze the code for performance optimization opportunities. Focus on:
-
Algorithm Efficiency
- Time complexity analysis
- Space complexity analysis
- Suggest more efficient algorithms
-
Database Optimization
- Query optimization
- Index recommendations
- N+1 query problems
- Caching opportunities
-
Memory Management
- Memory leaks
- Unnecessary object creation
- Resource cleanup
-
Code Structure
- Redundant computations
- Unnecessary loops or iterations
- Lazy loading opportunities
-
Network/IO Operations
- Batch operations
- Connection pooling
- Async/await optimization
-
Caching Strategy
- What should be cached
- Cache invalidation strategy
- Memory vs performance tradeoffs
Provide specific refactoring suggestions with before/after code examples showing the performance improvements.