kent williams
2011-Dec-30 21:12 UTC
[LLVMdev] Why is CLANG++ so freaking slow -- with example.
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?
Benjamin Kramer
2011-Dec-30 21:34 UTC
[LLVMdev] Why is CLANG++ so freaking slow -- with example.
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
kent williams
2011-Dec-30 21:47 UTC
[LLVMdev] Why is CLANG++ so freaking slow -- with example.
It is a release build. On Fri, Dec 30, 2011 at 3:34 PM, Benjamin Kramer <benny.kra at googlemail.com> 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). > > - Ben > >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Nick Lewycky
2011-Dec-30 22:10 UTC
[LLVMdev] Why is CLANG++ so freaking slow -- with example.
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 >