[cfe-dev] Weird clang++ slowness

Benjamin Kramer benny.kra at gmail.com
Fri Oct 25 04:32:56 PDT 2013


> On 25.10.2013, at 13:13, "Óscar Fuentes" <ofv at wanadoo.es> wrote:
>
> I found certain source files which are taking a lot of time to compile.
> Upon investigation I measured this times:
>
>
> 9.8 seconds for command: clang++ -c -std=c++11 file.cpp
>
> 0.2 seconds for command: clang++ -E -std=c++11 file.cpp > f.CC
>    (creates a 2.9 MB file)
>
> 3.4 seconds for command: clang++ -c -std=c++11 f.CC
>
>
> So explicitly preprocessing and then compiling takes less than half the
> time of compiling the original file.
>
> I guess this is due to macro expansion tracking for diagnostic purposes.
> The C++ file contains some errors (it belongs to a test suite) although
> I see no references to macros on the output of the compiler.
>
> So how can I speed up the compilation? Can this be considered a bug?

Could be a bug or just macro tracking with very deep instantiations.
Impossible to say without a test case.

- Ben
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list