FreeBSD Compiler Benchmark: gcc-base vs. gcc-ports vs. clang

Alexander Leidinger Alexander at Leidinger.net
Fri Mar 11 15:01:34 UTC 2011


Quoting Martin Matuska <mm at FreeBSD.org> (from Thu, 10 Mar 2011  
22:33:37 +0100):

> Hi everyone,
>
> we have performed a benchmark of the perl binary compiled with base gcc,
> ports gcc and ports clang using the perlbench benchmark suite.
> Our benchmark was performed solely on amd64 with 10 different processors
> and we have tried different -march= flags to compare binary performance
> of the same compiler with different flags.
>
> Here is some statistics from the results:
> - clang falls 10% behind the base gcc 4.2.1 (test average)
> - gcc 4.5 from ports gives 5-10% better average performance than the
> base gcc 4.2.1

Can you rule out gcc specific optimizations as a cause of this  
difference for clang? As an example of what I mean: the configure  
script of LAME will use additional optimization flags if it detects  
gcc (even depending on the version of gcc). For clang (or other  
compilers which have similar flags than gcc but are not identified as  
gcc) there it will not use add those flags. Another possibility are  
preprocessor checks for gcc-specific defines (in case clang does not  
provide the same predefined defines, I do not know)?

Bye,
Alexander.

-- 
This MUST be a good party -- My RIB CAGE is being painfully pressed up
against someone's MARTINI!!

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-current mailing list