4 ms·
> The reality is that for any language, including C, compiler optimized code will never be as fast as hand optimized code That's not strictly true; sometimes a
by GrantMoyer 2y ago
> The reality is that for any language, including C, compiler optimized code will never be as fast as hand optimized code
That's not strictly true; sometimes a C compiler can optimize away my whole program: https://godbolt.org/z/oG5nfGE6z https://godbolt.org/z/oG5nfGE6z
- wyager 2y agoYou're doing extremely simple constant arithmetic here. GHC can optimize this type of thing away to nothing as well. Are we talking about contrived examples or real numerical bottlenecks?
- Twisol 2y agoI think it was a joke about compilers removing code by reasoning about undefined behavior.