packages icon indicating copy to clipboard operation
packages copied to clipboard

clang start up is very slow compared to gcc (T10393)

Open celticmagic opened this issue 2 years ago • 1 comments

Joey Riches (#joebonrichie), 2022-09-19 15:06:43 UTC

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.

celticmagic avatar Aug 16 '23 17:08 celticmagic

@joebonrichie Is this still an issue?

ermo avatar May 04 '24 01:05 ermo