[cfe-dev] Clang versus GCC speed

Jean-Daniel Dupas devlists at shadowlab.org
Fri Nov 20 11:46:37 PST 2009


Le 20 nov. 2009 à 20:43, Douglas Gregor a écrit :

> 
> On Nov 20, 2009, at 11:07 AM, Jean-Daniel Dupas wrote:
> 
>> 
>> Le 20 nov. 2009 à 19:36, David Chisnall a écrit :
>> 
>>> Hi,
>>> 
>>> Has anyone done any tests comparing gcc compilation speed to clang
>>> recently?  I just did some tests with Objective-C programs and found
>>> clang much slower than GCC 4.2, with an optimized build of LLVM and
>>> Clang and a stock build of GCC.
>>> 
>>> David
>>> 
>> 
>> 
>> Just a quick test gave me this on an Objective-C project:
>> 
>> Clang (r89342) (Note that I replaced Xcode's clang binaries by a svn version so it uses it when I pass com.apple.compilers.llvm.clang.1_0)
>> time xcodebuild -configuration Release GCC_VERSION=com.apple.compilers.llvm.clang.1_0 ARCHS=i386
>> 	68.314u 16.219s 1:07.79 124.6%	0+0k 17+476io 0pf+0w
>> 
>> GCC-4.2:
>> time xcodebuild -configuration Release ARCHS=i386
>> 	127.909u 45.820s 2:02.94 141.3%	0+0k 0+639io 0pf+0w
> 
> I'm guessing that you're using precompiled headers. Clang usually tops out at about 30% faster than GCC without precompiled headers, with much better performance when we're using precompiled headers.
> 
> 	- Doug



You're right. I'm using a precompile header that imports <Cocoa/Cocoa.h>.


-- Jean-Daniel








More information about the cfe-dev mailing list