3 ms·
This is... not an example of good optimization. Focusing on micro-"optimizations" like this one do absolutely nothing for performance (how many times are you a
by aappleby 7mo ago
This is... not an example of good optimization.
Focusing on micro-"optimizations" like this one do absolutely nothing for performance (how many times are you actually calling Instance() per frame?) and skips over the absolutely-mandatory PROFILE BEFORE YOU OPTIMIZE rule.
If a coworker asked me to review this CL, my comment would be "Why are you wasting both my time and yours?"
- thomasmg 7mo agoOptimizing requires a (performane) problem, and often needs a benchmark. In my view, the article is not about optimizing, but about understanding how things work under the hood. Which is interesting for some.
- delusional 7mo ago> If a coworker asked me to review this CL, my comment would be "Why are you wasting both my time and yours?" If a coworker submitted a patch to existing code, I'd be right there with you. If they submitted new code, and it just so happened to be using this more optimal strategy, I wouldn't blink twice before accepting it.
- tialaramex 7mo agoAmong C++ programmers "Best performance" isn't about actual optimization it's a brag with about the same semantic value as for Broadway and so it's not measurable. The woman who wins a Tony for "Best performance in a musical" isn't measurably faster, or smaller, she's just "best" according to some panel. Did audiences like it? Did the musical make money? Doesn't matter, she won a "Best performance" Tony.
- pjmlp 7mo agoOnly those that have C++ tatoos and their whole career bound to mastering a single language, selling that knowledge. Other of us, use it as tool required to integrate with existing products, language runtimes, and SDKs written in C++, which most likely won't get replaced anytime soon.
- secondcoming 7mo agoHow is performance not measurable? Getting into the weeds of what a compiler does with your code is fun. People have been doing micro optimisations since computers became a thing, you benefit from them every day without realising - and seemingly not appreciating - it.
- tialaramex 7mo ago[dead]