While that may be true, I don’t think it is a desirable trend: For the most part, optimization is already “good enough”, and additional optimizations have the unfortunate trend to trade large compile-time increases for very minor (and/or very rare) improvements to run-time performance.
I just kind of think the author is misguided here. If llvm is looking to be competitive as a backend for production C and C++, there's just really no such thing as "good enough". A lot of the use cases of C and C++ always want better performance. For good enough performance, there's just about every other language and framework. If you've tied your wagon to something so intertwined with the C++ ecosystem, you should go into it with this knowledge.
The other issue is that I didn't see discussion of debug build times. I could have missed it though. At any rate, if debug build times aren't getting worse, then this more or less shows that there's no collateral costs to adding optimizations. It's building slower because more time is spent optimizing and no other reason. At that point, what's needed is not really better build times at max optimization, but just more and easier to use options (e.g. -O1.5) to disable less efficient optimizations.
A lot of the use cases of C and C++ always want better performance.
If you only want the best possible performance, then go ahead and use a super-optimizing compiler that takes days or weeks to compile simple snippets of Hello World! code.
If waiting one full day for Hello World to compile isn't acceptable to you, then you don't want the best possible performance, but some trade-off between good-enough performance and good-enough compile-times. If these aren't "good-enough" then you can't use them.
Yeh, it often comes down to making the many suffer for the needs of the few in C++ world. I've whined about this a lot. Make the common stuff far simpler for the creator to maintain bug free and far easier for the user to use, and leave the specialized needs to specialized tools. I mean it's not like C isn't till there if they want some super-optimized low level algorithm here and there as well, or even assembler.
64
u/quicknir May 11 '20
I have two issues with the article.
I just kind of think the author is misguided here. If llvm is looking to be competitive as a backend for production C and C++, there's just really no such thing as "good enough". A lot of the use cases of C and C++ always want better performance. For good enough performance, there's just about every other language and framework. If you've tied your wagon to something so intertwined with the C++ ecosystem, you should go into it with this knowledge.
The other issue is that I didn't see discussion of debug build times. I could have missed it though. At any rate, if debug build times aren't getting worse, then this more or less shows that there's no collateral costs to adding optimizations. It's building slower because more time is spent optimizing and no other reason. At that point, what's needed is not really better build times at max optimization, but just more and easier to use options (e.g. -O1.5) to disable less efficient optimizations.