I’ve started building a number of large C and C++ packages regularly again (chromium, Linux kernel, gcc and others) so I thought it would be useful to get a sense of how fast the current compilers are relative to each other.
For my testcase I chose a library from the LLVM 2.8 toolchain. I went with 2.8 as it’s the newest version I found that would compile with GCC (g++) 3.4. I originally hoped to find a test that would build with all versions of g++ going back to 2.7, but unfortunately the C++ language specifications and compiler strictness have changed a lot in 20 years, so that wasn’t possible. I compared built time using debug options (-O0 -g), standard build options (-O2 -g) and optimized build options (-O3 alone). Time was measured in seconds.