4 ms·
I think you need to reevaluate what happens to code once optimizations are turned on. Especially if you can afford to do test guided PGO combined with LTO. The
by SleepyMyroslav 3y ago
I think you need to reevaluate what happens to code once optimizations are turned on. Especially if you can afford to do test guided PGO combined with LTO.
There is nothing in common between how code is executed with optimization and what were programmers writing years ago. It is like 5-10 levels of functions are just gone and completely restructured by compiler. I do not see middle ground if people want to keep the performance. Old C++ and likely C that failed to optimize is just gone at the moment.
Whatever legacy code has to be "preserved" is likely to be specifically deoptimized to keep it in frozen state.
PS I come from gamedev and I really wish compilers left us control of what is going on there.
- kragen 3y agoinlining code and most code-movement optimizations are among the many optimizations that don't require the kind of nasty tricks with undefined behavior that i'm criticizing, and it's been common practice for decades; c++ has depended on method inlining to get acceptable performance since the 80s it's kind of a pain if you're stepping through the code in gdb but that's acceptable turning off optimization entirely is still too costly for most cases