Analyze and optimize this code for maximum performance:
Coding💾 0 savesby PromptChief
Analyze and optimize this code for maximum performance:
```
[[SELECTED_TEXT]]
```
Investigate:
1. **Algorithmic complexity** – are there more efficient algorithms?
2. **Database access** – N+1 problems, missing indexes, unnecessary queries
3. **Memory usage** – unnecessary copies, memory leaks
4. **Caching opportunities** – what can be cached?
5. **Parallelization** – what can run async/parallel?
Show optimized code + expected performance improvement.