<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hello LLVM/Clang developers,</div><div><br></div><div>We recently switched to use the same clang version on all our platforms. This included switching from apple-clang from xcode to a pre-built binary we downloaded from <a href="http://llvm.org">llvm.org</a>. We noticed that this actually came with a pretty big performance regression in compile times.</div><div><br></div><div>If we do the simplest test program like this:</div><div><br></div><div>#include <string><br>#include <iostream><br>int main()<br>{<br>    std::cout << "Hello world" << std::endl;<br>}</div><div><br></div><div>and compile that with Xcode Clang (Xcode 10.1 apple-clang clang-1000.11.45.5):</div><div>clang++ test.cpp -o test  0.31s user 0.06s system 97% cpu 0.380 total</div><div><br></div><div>with clang 7 binaries found on <a href="http://llvm.org">llvm.org</a> 7.0.0:</div><div>~/Downloads/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++ -o test test.cpp  0.53s user 0.11s system 62% cpu 1.032 total</div><div><br></div><div>If we now run that on our whole project:</div><div>with xcode clang:</div><div>368.17s user 32.00s system 663% cpu 1:00.30 total</div><div><br></div><div>with clang 7:</div><div>423.31s user 31.65s system 662% cpu 1:08.69 total</div><div><br></div><div>That's a pretty hefty difference. Any ideas what can account for this discrepancy? Does apple-clang contain any special patches or build flags that differ a lot from the binaries on <a href="http://llvm.org">llvm.org</a>?</div><div><br></div><div>I know about PGO - and I guess the best we could do is to get profile data out of compiling my whole tree and use that when building clang - but this process seems not very well documented and unsure if this would even help.</div><div><br></div><div>Thankful for any ideas or feedback.</div><div>Tobias<br></div></div></div></div></div></div></div></div>