[cfe-dev] Clang versus GCC speed

Fariborz Jahanian fjahanian at apple.com
Fri Nov 20 13:14:52 PST 2009


On Nov 20, 2009, at 1:04 PM, David Chisnall wrote:

>
> On 20 Nov 2009, at 18:55, Douglas Gregor wrote:
>
>> On Nov 20, 2009, at 10:36 AM, David Chisnall wrote:
>>> 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.
>>
>>
>> This isn't what we're seeing. We're seeing Clang being consistently
>> faster than GCC 4.2.
>>
>> Are you certain that you built LLVM and Clang in Release-Asserts?
>> Debug builds are horribly slow, and Release builds are still a bit
>> slower than Release-Asserts builds.
>
> I was using the wrong binary.  Running the tests again, there's about
> a 10% variation in speeds each time I run clang and gcc, but they both
> end up being approximately the same speed.  Using -fsyntax-only on
> GNUstep's Cocoa.h takes slightly longer with clang than GCC on
> average, although the fastest result for clang is slightly better than
> the slowest result for gcc.
>
> Are your tests relative to Apple's GCC?  It's a lot slower than FSF
> GCC for Objective-C, at least - not sure why, but FSF GCC can usually
> compile a couple of files before Apple GCC reports the first warning
> in one.

Apple's default for objc is the non-fragile abi, while FSF's is the  
fragile-abi.
Make sure to use the same abi for both.

- Fariborz

>



More information about the cfe-dev mailing list