3 ms·
"Basic LTO" is also functionally analogous to a "unity build", i.e., smushing together each source file into a single compilation unit. There are some caveats,
by dundarious 3y ago
"Basic LTO" is also functionally analogous to a "unity build", i.e., smushing together each source file into a single compilation unit. There are some caveats, but it's a valuable technique.
- dontlaugh 3y agoExtremely common in the games industry.
- matheusmoreira 3y agoDoes LTO allow the exact same optimization opportunities as unity builds with all static functions? I remember reading that unity builds still result in more optimized code. SQLite amalgamation comes to mind. https://www.sqlite.org/amalgamation.html https://www.sqlite.org/amalgamation.html > And because all code is in a single translation unit, compilers can do better inter-procedure and inlining optimization resulting in machine code that is between 5% and 10% faster.
- dundarious 3y agoIn all likelihood, LTO will always be a strict subset of what you can get from a unity build, in terms of optimization, because it requires additional work to implement. It may be/become very very close, though. I prefer to use unity builds for various reasons.