Open 153465f3-2020-4b1e-8351-d0d14d812a9b opened 10 years ago
Just to add one more data point to this issue: after making a simple change on a C++ source file, clang seemed stuck while compiling it. After 2 minutes I killed the process thinking that it was in a infinite loop. Then remembered this issue and tried to compile with g++. Sure enough, there was a typo introduced by the change. After fixing the typo clang compiled the C++ file in a few seconds.
-fno-spell-checking makes the slowness go away.
Forgot to mention that compiling the preprocessed source halves the compile time. That is, preprocessing and then compiling the resulting output takes half the time of compiling the original file.
Extended Description
This test case:
include "boost/asio.hpp"
double mainf(); int mainf() { foo(sdafo_2, 0); return 0; }
takes this time to compile:
Time (seconds) Command 6.8 clang -c -std=c++11 test.cpp 4.8 clang -c test.cpp
1.0 clang -c test.cpp
2.8 clang -c test.cpp
Note how Clang needs a long time to compute the diagnostic about
sdafo_2' after reporting the diagnostic about the illegal overload of
mainf'.