[LLVMbugs] [Bug 6958] New: Performance issue.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 27 16:35:31 PDT 2010


           Summary: Performance issue.
           Product: clang
           Version: 2.7
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ldm at thorgal.homelinux.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

Everything I read on LLVM's site indicate that clang is markedly faster than
g++ (http://clang.llvm.org/performance.html). I develop a large C++ project
(close to 1M LOC)  with g++ on MacOS and Linux and MSDev on windows. The code
is portable and true C++. When I saw the release of 2.7 with (apparently) good
support for C++, I thought I'd give it a spin on a file or two to see the
performance level. I compiled one C++ source file (LocRuntime.C)

-rw-r--r--@ 1 ldm  ldm  66790 Apr  4 18:13 LocRuntime.C

On a MacOS 10.6.3 system

Darwin tanatlocwl.linux.home 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26
11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386

The compilation options are for debug. Nothing fancy. Maybe a few thousand
class prototypes and a few dozen class compiled here. 

I timed the stock g++ and clang++. Here is the comparison.

tanatlocwl:runtime ldm$ time g++-4.0 -msse2 -msse -c -D_REENTRANT
-DCOMETVER='"2.1.0"' -DCOMETBUILD='"0eb0b297a134c494febffb68405ee0efce2bcde8"' 
-fPIC -g  -Woverloaded-virtual   -DX11GUI=1 -I. -I../include -I../data
-I../localizer -I/sw/include -I../include/data LocRuntime.C 
real    0m2.497s
user    0m2.267s
sys    0m0.224s


tanatlocwl:runtime ldm$ time
-msse2 -msse -c -D_REENTRANT -DCOMETVER='"2.1.0"'
-DCOMETBUILD='"0eb0b297a134c494febffb68405ee0efce2bcde8"'  -fPIC -g 
-Woverloaded-virtual   -DX11GUI=1 -I. -I../include -I../data -I../localizer
-I/sw/include -I../include/data LocRuntime.C

real    0m3.785s
user    0m3.552s
sys    0m0.193s

This is with the binaries for Darwin from the llvm site (for 2.7). 

So the comparison gives gcc-4.0 as the clear winner with  2.5s realtime vs.
3.8s for clang++ for the simplest compilation options that are in use during
the development cycle (when one wishes the compiler to be really fast). 

What am I missing? 

(I'd love to switch to a faster compiler for everyday use!)

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list