The most expensive performance work is the kind that fixes the wrong thing. A week spent optimizing a query that runs twice a day while the real bottleneck, an unindexed join on every page load, keeps burning users.
The fix is unglamorous: measure first. Slow query logs, request timing, a profiler run against real usage. The data almost always surprises you, the bottleneck is rarely where intuition put it.
Optimization without measurement is guessing with extra steps. Profile, fix the actual hotspot, measure again. The loop is short when you let the numbers lead.