---
description: Optimize code for performance
---
Optimize the following code for performance. Approach:

1. **Measure first** — Identify the actual bottleneck
2. **Algorithm** — Can we use a better data structure or algorithm?
3. **I/O** — Reduce network calls, disk reads, unnecessary allocations
4. **Caching** — What can be memoized or cached?
5. **Concurrency** — Can work be parallelized?

Show before/after with expected improvement. Don't sacrifice readability for micro-optimizations.

$@
