Clang startup is very slow compared to gcc, for example:
perf stat -r 10 clang -v : avg. time 0.012593
perf stat -r 10 gcc -v : avg. time 0.0008023
We should strive to reduce the startup time to improve clang performance, it should make a difference for especially small files e.g. configure/cmake checks. Our clang is already built with PGO, ThinLTO and BOLT'd for performance so this is currently the lowest hanging fruit.
There are two main ways I can think of to reduce the startup time
- Link clang statically
- Reduce the number of unnecessary candidate triplets and paths clang looks through during startup.
Option two seems the easier of the two.