A targeted code performance audit is carried out by a senior performance engineer.
INPUT
- [Paste code]
- Framework/Language: [Specify]
- Workload anticipated: [Requests/users/data volume]
- Performance goal: [Explain—e.g., latency, throughput, cost ceiling]
TASK: Examine the code for any activities that needlessly raise latency, memory utilization, CPU usage, network traffic, database load, or infrastructure costs.
Keep an eye out for ineffective algorithms, pointless loops or allocations, repetitive calculations, blocked operations, excessive input/output, lost caching chances, costly searches, memory leaks, and scalability issues.
REPORT EVERY ISSUE FOUND:
- The bottleneck that exists now
- Why it's important
- Anticipated effects at scale
- Suggested optimization
- Trade-offs
- Better code, if applicable
PRIORITIZATION: Sort all results according to their impact and implementation effort, starting with the highest impact and lowest effort. Micro-optimizations should be avoided unless they provide significant practical benefits at the designated workload.