GCC vs. LLVM Clang 3.8 3.9 Compiler Benchmarking

Benchmarks by Michael Larabel for a future article on phoronix looking at early GCC 7 compiler performance compared to GCC 6 and GCC 5 and then LLVM Clang 3.8 and Clang 3.9.

HTML result view exported from: https://openbenchmarking.org/result/1609139-LO-GCCCLANG151&rdt&grs.

GCC vs. LLVM Clang 3.8 3.9 Compiler BenchmarkingProcessorMotherboardChipsetMemoryDiskGraphicsAudioNetworkOSKernelDesktopDisplay ServerDisplay DriverOpenGLCompilerFile-SystemScreen ResolutionGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0Intel Xeon E5-2609 v4 @ 1.70GHz (8 Cores)MSI X99A WORKSTATION (MS-7A54) v1.0Intel Xeon E7 v4/Xeon16384MB3 x 120GB TOSHIBA-TR150LLVMpipeRealtek ALC1150Intel ConnectionUbuntu 16.044.8.0-999-generic (x86_64) 20160908Unity 7.4.0X Server 1.18.3modesetting 1.18.33.3 Mesa 11.2.0 Gallium 0.4GCC 5.4.0ext41024x768GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0-svn279689-1~exp1Clang 3.8.0-2ubuntu4OpenBenchmarking.orgEnvironment Details- LIBGL_ALWAYS_SOFTWARE=1Compiler Details- GCC 5.4.0, GCC 6.2.0, GCC 7.0.0 20160904: --disable-multilib --enable-checking=release --enable-languages=c,c++,fortranDisk Details- CFQ / data=ordered,errors=remount-ro,relatime,rwProcessor Details- Scaling Governor: intel_pstate powersave

GCC vs. LLVM Clang 3.8 3.9 Compiler Benchmarkingscimark2: Monte Carloscimark2: Dense LU Matrix Factorizationc-ray: Total Timescimark2: Compositesmallpt: Global Illumination Renderer; 100 Samplesscimark2: Jacobi Successive Over-Relaxationhimeno: Poisson Pressure Solverbuild-imagemagick: Time To Compilescimark2: Sparse Matrix Multiplybuild-php: Time To Compilehint: FLOATencode-mp3: WAV To MP3lammps: Rhodopsin Proteinhmmer: Pfam Database Searchebizzy: Phoronix Test Suite v6.6.0openssl: RSA 4096-bit Performancefftw: Float + SSE - 2D FFT Size 4096n-queens: Elapsed Timefhourstones: Complex Connect-4 Solvingbullet: 3000 Fallapache: Static Web Page Servingbullet: 136 Ragdollsscimark2: Fast Fourier Transformredis: GETfftw: Float + SSE - 1D FFT Size 4096redis: SETbullet: Raytestspgbench: Buffer Test - Normal Load - Read Writeencode-flac: WAV To FLACpgbench: Buffer Test - Single Thread - Read Writemafft: Multiple Sequence AlignmentGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0304.101327.1521.30695.7047571.65893.8267.211047.4035.31177738053.3222.8472.0012.18155360569.377410.5057.536954.679.1327564.726.45228.181434042.9210966969029.105.944468.8213.45552.555.99304.071302.7421.25738.2147572.051091.3294.511280.0236.25166219905.0422.4212.18155273569.277515.9856.216884.939.1128383.226.46232.191408567.4110936972159.315.984411.7513.44546.216.41304.031596.9023.36800.6430572.061095.9081.271290.9436.52165733740.3322.0312.22155692570.207517.9452.546905.309.0129512.136.40239.271393442.9610951965269.605.964437.2513.45549.496.45126.432917.9644.421115.00856.35841.5578.451448.2235.25143252876.2027.4662.3013.76138671511.076923.646563.479.8327344.426.92226.011348061.0410331933433.876.214356.3813.15531.797.27126.462936.8539.341111.78857.42748.0974.341414.4828.45141990405.6926.9463.2212.37152747566.806841.347164.379.5729812.186.89223.711342892.9610357925939.116.204411.7213.26538.447.74OpenBenchmarking.org

SciMark

Computational Test: Monte Carlo

OpenBenchmarking.orgMflops, More Is BetterSciMark 2.0Computational Test: Monte CarloGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.070140210280350SE +/- 0.00, N = 4SE +/- 0.00, N = 4SE +/- 0.00, N = 4SE +/- 0.15, N = 4SE +/- 0.02, N = 4304.10304.07304.03126.43126.461. (CXX) g++ options: -O3 -march=native

SciMark

Computational Test: Dense LU Matrix Factorization

OpenBenchmarking.orgMflops, More Is BetterSciMark 2.0Computational Test: Dense LU Matrix FactorizationGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.06001200180024003000SE +/- 9.92, N = 4SE +/- 0.23, N = 4SE +/- 0.14, N = 4SE +/- 1.74, N = 4SE +/- 0.55, N = 41327.151302.741596.902917.962936.851. (CXX) g++ options: -O3 -march=native

C-Ray

Total Time

OpenBenchmarking.orgSeconds, Fewer Is BetterC-Ray 1.1Total TimeGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.01020304050SE +/- 0.01, N = 3SE +/- 0.01, N = 3SE +/- 0.01, N = 3SE +/- 0.01, N = 3SE +/- 0.08, N = 321.3021.2523.3644.4239.341. (CC) gcc options: -lm -lpthread -O3 -march=native

SciMark

Computational Test: Composite

OpenBenchmarking.orgMflops, More Is BetterSciMark 2.0Computational Test: CompositeGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.02004006008001000SE +/- 2.13, N = 4SE +/- 0.14, N = 4SE +/- 0.09, N = 4SE +/- 0.69, N = 4SE +/- 0.09, N = 4695.70738.21800.641115.001111.781. (CXX) g++ options: -O3 -march=native

Smallpt

Global Illumination Renderer; 100 Samples

OpenBenchmarking.orgSeconds, Fewer Is BetterSmallpt 1.0Global Illumination Renderer; 100 SamplesGCC 5.4.0GCC 6.2.0GCC 7.0.0 201609041122334455SE +/- 0.33, N = 3SE +/- 0.88, N = 3SE +/- 0.00, N = 34747301. (CXX) g++ options: -fopenmp -O3 -march=native

SciMark

Computational Test: Jacobi Successive Over-Relaxation

OpenBenchmarking.orgMflops, More Is BetterSciMark 2.0Computational Test: Jacobi Successive Over-RelaxationGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.02004006008001000SE +/- 0.41, N = 4SE +/- 0.00, N = 4SE +/- 0.01, N = 4SE +/- 0.04, N = 4SE +/- 0.01, N = 4571.65572.05572.06856.35857.421. (CXX) g++ options: -O3 -march=native

Himeno Benchmark

Poisson Pressure Solver

OpenBenchmarking.orgMFLOPS, More Is BetterHimeno Benchmark 3.0Poisson Pressure SolverGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.02004006008001000SE +/- 0.49, N = 3SE +/- 1.34, N = 3SE +/- 0.65, N = 3SE +/- 1.07, N = 3SE +/- 0.07, N = 3893.821091.321095.90841.55748.091. (CC) gcc options: -O3 -march=native -mavx2

Timed ImageMagick Compilation

Time To Compile

OpenBenchmarking.orgSeconds, Fewer Is BetterTimed ImageMagick Compilation 6.9.0Time To CompileGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.020406080100SE +/- 0.01, N = 3SE +/- 0.17, N = 3SE +/- 0.14, N = 3SE +/- 0.22, N = 3SE +/- 0.05, N = 367.2194.5181.2778.4574.34

SciMark

Computational Test: Sparse Matrix Multiply

OpenBenchmarking.orgMflops, More Is BetterSciMark 2.0Computational Test: Sparse Matrix MultiplyGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.030060090012001500SE +/- 2.22, N = 4SE +/- 0.17, N = 4SE +/- 0.35, N = 4SE +/- 2.31, N = 4SE +/- 0.32, N = 41047.401280.021290.941448.221414.481. (CXX) g++ options: -O3 -march=native

Timed PHP Compilation

Time To Compile

OpenBenchmarking.orgSeconds, Fewer Is BetterTimed PHP Compilation 5.2.9Time To CompileGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0816243240SE +/- 0.06, N = 3SE +/- 0.09, N = 3SE +/- 0.05, N = 3SE +/- 0.40, N = 3SE +/- 0.17, N = 335.3136.2536.5235.2528.451. (CC) gcc options: -O3 -march=native -pedantic -ldl -lz -lm

Hierarchical INTegration

Test: FLOAT

OpenBenchmarking.orgQUIPs, More Is BetterHierarchical INTegration 1.0Test: FLOATGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.040M80M120M160M200MSE +/- 355658.03, N = 3SE +/- 165686.10, N = 3SE +/- 291268.73, N = 3SE +/- 131098.46, N = 3SE +/- 15968.48, N = 3177738053.32166219905.04165733740.33143252876.20141990405.691. (CC) gcc options: -O3 -march=native -lm

LAME MP3 Encoding

WAV To MP3

OpenBenchmarking.orgSeconds, Fewer Is BetterLAME MP3 Encoding 3.99.3WAV To MP3GCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0612182430SE +/- 0.01, N = 5SE +/- 0.03, N = 5SE +/- 0.01, N = 5SE +/- 0.04, N = 5SE +/- 0.04, N = 522.8422.4222.0327.4626.941. (CC) gcc options: -O3 -ffast-math -funroll-loops -fschedule-insns2 -fbranch-count-reg -fforce-addr -pipe -march=native -lm

LAMMPS Molecular Dynamics Simulator

Test: Rhodopsin Protein

OpenBenchmarking.orgLoop Time, Fewer Is BetterLAMMPS Molecular Dynamics Simulator 1.0Test: Rhodopsin ProteinGCC 5.4.0Clang 3.9.0Clang 3.8.01632486480SE +/- 0.12, N = 3SE +/- 0.09, N = 3SE +/- 0.14, N = 372.0062.3063.221. (CXX) g++ options: -lfftw -lmpich

Timed HMMer Search

Pfam Database Search

OpenBenchmarking.orgSeconds, Fewer Is BetterTimed HMMer Search 2.3.2Pfam Database SearchGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.048121620SE +/- 0.03, N = 3SE +/- 0.01, N = 3SE +/- 0.02, N = 3SE +/- 0.04, N = 3SE +/- 0.02, N = 312.1812.1812.2213.7612.371. (CC) gcc options: -O3 -march=native -pthread -lhmmer -lsquid -lm

ebizzy

Phoronix Test Suite v6.6.0

OpenBenchmarking.orgRecords/s, More Is Betterebizzy 0.3Phoronix Test Suite v6.6.0GCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.030K60K90K120K150KSE +/- 87.83, N = 3SE +/- 68.34, N = 3SE +/- 360.05, N = 3SE +/- 392.88, N = 3SE +/- 2308.58, N = 41553601552731556921386711527471. (CC) gcc options: -pthread -lpthread -O3 -march=native

OpenSSL

RSA 4096-bit Performance

OpenBenchmarking.orgSigns Per Second, More Is BetterOpenSSL 1.0.1gRSA 4096-bit PerformanceGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0120240360480600SE +/- 0.58, N = 3SE +/- 1.31, N = 3SE +/- 0.25, N = 3SE +/- 2.68, N = 3SE +/- 1.57, N = 3569.37569.27570.20511.07566.801. (CC) gcc options: -m64 -O3 -lssl -lcrypto -ldl

FFTW

Build: Float + SSE - Size: 2D FFT Size 4096

OpenBenchmarking.orgMflops, More Is BetterFFTW 3.3.4Build: Float + SSE - Size: 2D FFT Size 4096GCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.016003200480064008000SE +/- 43.96, N = 5SE +/- 22.70, N = 5SE +/- 15.43, N = 5SE +/- 16.42, N = 5SE +/- 36.82, N = 57410.507515.987517.946923.646841.341. (CC) gcc options: -O3 -march=native -lm

N-Queens

Elapsed Time

OpenBenchmarking.orgSeconds, Fewer Is BetterN-Queens 1.0Elapsed TimeGCC 5.4.0GCC 6.2.0GCC 7.0.0 201609041326395265SE +/- 0.01, N = 3SE +/- 0.01, N = 3SE +/- 0.01, N = 357.5356.2152.541. (CC) gcc options: -static -fopenmp -O3 -march=native

Fhourstones

Complex Connect-4 Solving

OpenBenchmarking.orgKpos / sec, More Is BetterFhourstones 3.1Complex Connect-4 SolvingGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.015003000450060007500SE +/- 5.88, N = 3SE +/- 11.54, N = 3SE +/- 10.00, N = 3SE +/- 2.59, N = 3SE +/- 0.87, N = 36954.676884.936905.306563.477164.371. (CC) gcc options: -O3

Bullet Physics Engine

Test: 3000 Fall

OpenBenchmarking.orgSeconds, Fewer Is BetterBullet Physics Engine 2.81Test: 3000 FallGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.03691215SE +/- 0.01, N = 3SE +/- 0.02, N = 3SE +/- 0.00, N = 3SE +/- 0.02, N = 3SE +/- 0.02, N = 39.139.119.019.839.571. (CXX) g++ options: -O3 -march=native -rdynamic -lglut -lGL -lGLU

Apache Benchmark

Static Web Page Serving

OpenBenchmarking.orgRequests Per Second, More Is BetterApache Benchmark 2.4.7Static Web Page ServingGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.06K12K18K24K30KSE +/- 80.36, N = 3SE +/- 236.47, N = 3SE +/- 81.85, N = 3SE +/- 518.63, N = 3SE +/- 52.16, N = 327564.7228383.2229512.1327344.4229812.181. (CC) gcc options: -shared -fPIC -pthread -O3 -march=native

Bullet Physics Engine

Test: 136 Ragdolls

OpenBenchmarking.orgSeconds, Fewer Is BetterBullet Physics Engine 2.81Test: 136 RagdollsGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0246810SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.01, N = 3SE +/- 0.01, N = 36.456.466.406.926.891. (CXX) g++ options: -O3 -march=native -rdynamic -lglut -lGL -lGLU

SciMark

Computational Test: Fast Fourier Transform

OpenBenchmarking.orgMflops, More Is BetterSciMark 2.0Computational Test: Fast Fourier TransformGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.050100150200250SE +/- 0.13, N = 4SE +/- 0.38, N = 4SE +/- 0.16, N = 4SE +/- 1.03, N = 4SE +/- 0.36, N = 4228.18232.19239.27226.01223.711. (CXX) g++ options: -O3 -march=native

Redis

Test: GET

OpenBenchmarking.orgRequests Per Second, More Is BetterRedis 3.0.1Test: GETGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0300K600K900K1200K1500KSE +/- 2474.75, N = 3SE +/- 9042.38, N = 3SE +/- 5158.54, N = 3SE +/- 15364.63, N = 3SE +/- 2621.93, N = 31434042.921408567.411393442.961348061.041342892.96-std=gnu99 -pipe -g3 -O3 -funroll-loops -march=native1. (CC) gcc options: -ggdb -rdynamic -lm -pthread -ldl

FFTW

Build: Float + SSE - Size: 1D FFT Size 4096

OpenBenchmarking.orgMflops, More Is BetterFFTW 3.3.4Build: Float + SSE - Size: 1D FFT Size 4096GCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.02K4K6K8K10KSE +/- 68.86, N = 5SE +/- 44.65, N = 5SE +/- 50.75, N = 5SE +/- 39.29, N = 5SE +/- 40.65, N = 510966109361095110331103571. (CC) gcc options: -O3 -march=native -lm

Redis

Test: SET

OpenBenchmarking.orgRequests Per Second, More Is BetterRedis 3.0.1Test: SETGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0200K400K600K800K1000KSE +/- 4216.02, N = 3SE +/- 3624.82, N = 3SE +/- 2999.32, N = 3SE +/- 2866.48, N = 3SE +/- 2474.98, N = 3969029.10972159.31965269.60933433.87925939.11-std=gnu99 -pipe -g3 -O3 -funroll-loops -march=native1. (CC) gcc options: -ggdb -rdynamic -lm -pthread -ldl

Bullet Physics Engine

Test: Raytests

OpenBenchmarking.orgSeconds, Fewer Is BetterBullet Physics Engine 2.81Test: RaytestsGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0246810SE +/- 0.00, N = 3SE +/- 0.01, N = 3SE +/- 0.02, N = 3SE +/- 0.05, N = 3SE +/- 0.01, N = 35.945.985.966.216.201. (CXX) g++ options: -O3 -march=native -rdynamic -lglut -lGL -lGLU

PostgreSQL pgbench

Scaling: Buffer Test - Test: Normal Load - Mode: Read Write

OpenBenchmarking.orgTPS, More Is BetterPostgreSQL pgbench 9.4.3Scaling: Buffer Test - Test: Normal Load - Mode: Read WriteGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.010002000300040005000SE +/- 33.84, N = 3SE +/- 67.37, N = 5SE +/- 85.01, N = 3SE +/- 68.11, N = 3SE +/- 78.63, N = 34468.824411.754437.254356.384411.72-pthreads -mthreads-pthreads -mthreads1. (CC) gcc options: -fno-strict-aliasing -fwrapv -O3 -march=native -pthread -lpgcommon -lpgport -lpq -lpthread -lrt -lcrypt -ldl -lm

FLAC Audio Encoding

WAV To FLAC

OpenBenchmarking.orgSeconds, Fewer Is BetterFLAC Audio Encoding 1.3.1WAV To FLACGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.03691215SE +/- 0.01, N = 5SE +/- 0.01, N = 5SE +/- 0.01, N = 5SE +/- 0.01, N = 5SE +/- 0.01, N = 513.4513.4413.4513.1513.26-fvisibility=hidden-fvisibility=hidden-fvisibility=hidden1. (CXX) g++ options: -O3 -march=native -lm

PostgreSQL pgbench

Scaling: Buffer Test - Test: Single Thread - Mode: Read Write

OpenBenchmarking.orgTPS, More Is BetterPostgreSQL pgbench 9.4.3Scaling: Buffer Test - Test: Single Thread - Mode: Read WriteGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0120240360480600SE +/- 5.89, N = 3SE +/- 1.53, N = 3SE +/- 0.66, N = 3SE +/- 1.42, N = 3SE +/- 14.62, N = 6552.55546.21549.49531.79538.44-pthreads -mthreads-pthreads -mthreads1. (CC) gcc options: -fno-strict-aliasing -fwrapv -O3 -march=native -pthread -lpgcommon -lpgport -lpq -lpthread -lrt -lcrypt -ldl -lm

Timed MAFFT Alignment

Multiple Sequence Alignment

OpenBenchmarking.orgSeconds, Fewer Is BetterTimed MAFFT Alignment 6.864Multiple Sequence AlignmentGCC 5.4.0GCC 6.2.0GCC 7.0.0 20160904Clang 3.9.0Clang 3.8.0246810SE +/- 0.03, N = 3SE +/- 0.19, N = 6SE +/- 0.10, N = 6SE +/- 0.17, N = 6SE +/- 0.14, N = 65.996.416.457.277.741. (CC) gcc options: -O3 -lm -lpthread


Phoronix Test Suite v10.8.5