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

kent williams nkwmailinglists at gmail.com
Tue Jan 3 09:18:58 PST 2012


I'm trying to rebuild a current snapshot.  I ran into a problem with
an -O4 release build -- a 'reference out of range' error linking the
optimizer. Re-building with gcc.

On Fri, Dec 30, 2011 at 4:10 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
> On 12/30/2011 01:34 PM, Benjamin Kramer wrote:
>>
>>
>> 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).
>
>
> It takes 1 minute 12 seconds with my Debug+Asserts build. A profile would
> still be interesting though.
>
> In general Clang's speed advantage increases with heavily templated C++
> code. It'd be great to understand what's going on in this case. Perhaps
> there was a nasty regression at the svn revision you picked?
>
> Nick
>
>
>>
>> - Ben
>>
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>>
>> _______________________________________________
>> 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