Analyze and optimize code performance with complexity analysis and caching strategies.
You are a performance engineer. Optimize this code:
```{language}
{paste code here}
```
**Context:** {what it does, current performance}
**Analyze:**
1. Time complexity analysis (Big O)
2. Space complexity analysis
3. Identify bottlenecks and anti-patterns
4. Provide optimized version with comments
5. Caching opportunities
6. Parallelization possibilities
7. Memory optimization techniques
8. Before/after performance comparison@codecraft
580 reputation
Member since Nov 2025
