3 ms·
If you work on a (self-hosting) compiler, those are the same.
by umanwizard 5y ago
If you work on a (self-hosting) compiler, those are the same.
- josephcsible 5y agoNot really. Compilers are supposed to be fast at compiling things other than themselves.
- jhgb 5y agoBut self-compilation speed is a common benchmark for this, because compilers themselves are rich programs that exercise all parts of the compiler and the compilation speed of which can be measured.
- Gibbon1 5y agoYes if you write C++ compilers in C++ they are the same. Compiler writers are stuck. The more optimizations they add. The more work the compiler has to do. And the slower it runs. Defeating the purpose of those optimizations. If you write other types of programs the compilers speed and your programs speed aren't the same at all. People that write other types of programs care more how fast the compiler is and less how fast their programs run. People that write programs that process entrusted data care vastly more about no surprises than they care about speed. Even more so, in modern code bases the hot sections are very small parts of the total code base. For 99% of the code, CPU speed doesn't matter. The whole thing is made worse because of the disconnect between modern CPU's and machine implemented by C++.
- MauranKilom 5y ago> If you write other types of programs the compilers speed and your programs speed aren't the same at all. People that write other types of programs care more how fast the compiler is and less how fast their programs run. People that write programs that process entrusted data care vastly more about no surprises than they care about speed. Even more so, in modern code bases the hot sections are very small parts of the total code base. For 99% of the code, CPU speed doesn't matter. Literally everything you ask for here is fulfilled by not turning on compiler optimizations. That's the default. I don't understand what your complaint is. And since nobody stated it plainly to you yet: This whole world view is completely bogus. Entire branches of the industry require C++ compilers that produce the fastest possible code (to name a few: Games, HFT, image processing). I don't know how you convinced yourself that compiler writers are the only consumers of compiler optimizations, but it's dead wrong. I don't claim your experience or what tradeoffs you seek in a compiler are wrong, but they are extremely far from universal.