it’s not an optimization if you don’t measure an improvement.
This, so much. I often see this at work, theories about this and that being slow, or how something new « should » be better. As the resident code elder I often get to reply « why don’t you measure and find out »…
For some reason it seems nobody uses sampling profilers anymore, those tell you exactly where the time is spent, you don’t have to guess from a trace. Optimizing code is kind of a lost art.
Sometimes I wish compilers were better at data cache optimization, I work with C++ all the time but all of it needs to be done by hand (for example SoA vs AoS…). On the upside, I kind of have a good job security, at least until I retire.
For me what generally happens if I stop at 9PM, I will work through the problem in my sleep (and it will prevent me from getting a good night sleep), but I will often find a breakthrough the next morning during shower time.
I’m talking about those hard, multi-days debugging problems that nobody can figure out, but as someone else raised, that’s why I get paid good money for it.
It still sucks though. That first response in the thread rings so true, ok now I get it, no you don’t…