7 ms·
Alright. I'll comment. -- I find it interesting to learn just how much the Go compiler can "optimize your code away". That's both good and bad. The point on be
by prologic 3y ago
Alright. I'll comment. -- I find it interesting to learn just how much the Go compiler can "optimize your code away". That's both good and bad.
The point on benchmarking the right thing is 100% spot on, same goes for testing too. The optimization problem however is a bit too contrived IMO. When would you possible write code (aside from very trivial things) where the compiler would optimize all your code away, thus making your benchmarking invalid? I want to see a real-world example of where someone has been caught out by this?