Comment by dgan

Comment by dgan 15 hours ago

3 replies

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

dehrmann 2 hours ago

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.

ashwinsundar 5 hours ago

This is like the #1 cause of spaghetti, unmaintanable, deadlocked codebases - a single developer who knows every “best-practice” and optimization technique, and will not hesitate to apply it in every situation regardless of practicality or need, as a way to demonstrate their knowledge. It's the sign of an insecure developer - please stop.

glynnormington 11 hours ago

If there's a definite performance problem and a simple solution, then sure, go ahead. But applying every optimisation that comes to mind can produce a dog's breakfast of unmaintainable code and then when a real performance problem comes along, it can be really hard to fix.