Comment by dgan
Rolled my eyes on "For experts only: don't do it yet". Shut-up already. I will do it right now because it will nag me forever and then surface will grow, and every time the new code interacts whith what-could-ve-been-optimized I will spend 5min thinking if I should already optimize it
I used to work on FAANG-scale optimizations. Generally, the only code-level optimizations worth bothering with are ones with inefficient (think O(n^2) vs O(n) and caching) algorithms. Those get you because they work during testing, but fall over in prod. You should also optimize DB and RPC access patterns when appropriate. As things scale, there can be larger architectural changes that help. Finally, there are cute micro optimizations that everyone thinks will matter. They don't.