Existing Code Optimization Request
Feed in a slow or clunky piece of code and get back concrete optimization options instead of a rewritten version to trust blindly. - The specific change and where it applies - The expected performance improvement - Any trade-offs it introduces, such as readability, memory, or complexity - Useful as a first pass before profiling, or as a sanity check on optimizations you're already considering
Here's a piece of code that needs optimization:
{{code}}
Please suggest optimizations to improve its performance. For each suggestion, explain the expected improvement and any trade-offs.