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

Benjamin Kramer benny.kra at googlemail.com
Fri Dec 30 13:34:30 PST 2011


On 30.12.2011, at 22:12, kent williams wrote:

> 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?

Hi Kent,

are you using a Debug or Release build of clang? Debug builds are MUCH slower.
Your file takes less than a minute on my mac book pro (Release build).

- Ben

> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list