[LLVMdev] Why is CLANG++ so freaking slow -- with example.

kent williams nkwmailinglists at gmail.com
Fri Dec 30 13:12:04 PST 2011


http://cornwarning.com/xfer/test.cxx.gz

This is a preprocessed version of a file from from the VV image viewer
package.  I stripped out all the lines beginning in '#' and multiple
empty lines.

It's about 75k lines of code.

On a Mac Pro, the unix 'time' command says it's using 249 seconds of
user time.  Wall time on my machine somewhere around 5 minutes?

249.035u 1.883s 4:12.44 99.3%	0+0k 0+2io 0pf+0w

CLang version:

clang version 3.1 (trunk 146659)
Target: x86_64-apple-darwin10.8.0
Thread model: posix

I built this CLang myself from the svn source a few weeks back -- I
compiled it with gcc, and then re-compiled it with itself.

This is just one example. GCC compiles all of ITK and VTK in around an
hour. CLang++ takes 4 or 5 hours.

Does LLVM's speed advantage go away when it has to deal with heavily
templated C++ code?



More information about the llvm-dev mailing list