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. GCC 5.4.0: Processor: Intel Xeon E5-2609 v4 @ 1.70GHz (8 Cores), Motherboard: MSI X99A WORKSTATION (MS-7A54) v1.0, Chipset: Intel Xeon E7 v4/Xeon, Memory: 16384MB, Disk: 3 x 120GB TOSHIBA-TR150, Graphics: LLVMpipe, Audio: Realtek ALC1150, Network: Intel Connection OS: Ubuntu 16.04, Kernel: 4.8.0-999-generic (x86_64) 20160908, Desktop: Unity 7.4.0, Display Server: X Server 1.18.3, Display Driver: modesetting 1.18.3, OpenGL: 3.3 Mesa 11.2.0 Gallium 0.4, Compiler: GCC 5.4.0, File-System: ext4, Screen Resolution: 1024x768 GCC 6.2.0: Processor: Intel Xeon E5-2609 v4 @ 1.70GHz (8 Cores), Motherboard: MSI X99A WORKSTATION (MS-7A54) v1.0, Chipset: Intel Xeon E7 v4/Xeon, Memory: 16384MB, Disk: 3 x 120GB TOSHIBA-TR150, Graphics: LLVMpipe, Audio: Realtek ALC1150, Network: Intel Connection OS: Ubuntu 16.04, Kernel: 4.8.0-999-generic (x86_64) 20160908, Desktop: Unity 7.4.0, Display Server: X Server 1.18.3, Display Driver: modesetting 1.18.3, OpenGL: 3.3 Mesa 11.2.0 Gallium 0.4, Compiler: GCC 6.2.0, File-System: ext4, Screen Resolution: 1024x768 GCC 7.0.0 20160904: Processor: Intel Xeon E5-2609 v4 @ 1.70GHz (8 Cores), Motherboard: MSI X99A WORKSTATION (MS-7A54) v1.0, Chipset: Intel Xeon E7 v4/Xeon, Memory: 16384MB, Disk: 3 x 120GB TOSHIBA-TR150, Graphics: LLVMpipe, Audio: Realtek ALC1150, Network: Intel Connection OS: Ubuntu 16.04, Kernel: 4.8.0-999-generic (x86_64) 20160908, Desktop: Unity 7.4.0, Display Server: X Server 1.18.3, Display Driver: modesetting 1.18.3, OpenGL: 3.3 Mesa 11.2.0 Gallium 0.4, Compiler: GCC 7.0.0 20160904, File-System: ext4, Screen Resolution: 1024x768 Clang 3.9.0: Processor: Intel Xeon E5-2609 v4 @ 1.70GHz (8 Cores), Motherboard: MSI X99A WORKSTATION (MS-7A54) v1.0, Chipset: Intel Xeon E7 v4/Xeon, Memory: 16384MB, Disk: 3 x 120GB TOSHIBA-TR150, Graphics: LLVMpipe, Audio: Realtek ALC1150, Network: Intel Connection OS: Ubuntu 16.04, Kernel: 4.8.0-999-generic (x86_64) 20160908, Desktop: Unity 7.4.0, Display Server: X Server 1.18.3, Display Driver: modesetting 1.18.3, OpenGL: 3.3 Mesa 11.2.0 Gallium 0.4, Compiler: Clang 3.9.0-svn279689-1~exp1, File-System: ext4, Screen Resolution: 1024x768 Clang 3.8.0: Processor: Intel Xeon E5-2609 v4 @ 1.70GHz (8 Cores), Motherboard: MSI X99A WORKSTATION (MS-7A54) v1.0, Chipset: Intel Xeon E7 v4/Xeon, Memory: 16384MB, Disk: 3 x 120GB TOSHIBA-TR150, Graphics: LLVMpipe, Audio: Realtek ALC1150, Network: Intel Connection OS: Ubuntu 16.04, Kernel: 4.8.0-999-generic (x86_64) 20160908, Desktop: Unity 7.4.0, Display Server: X Server 1.18.3, Display Driver: modesetting 1.18.3, OpenGL: 3.3 Mesa 11.2.0 Gallium 0.4, Compiler: Clang 3.8.0-2ubuntu4, File-System: ext4, Screen Resolution: 1024x768 Apache Benchmark 2.4.7 Static Web Page Serving Requests Per Second > Higher Is Better GCC 5.4.0 .......... 27564.72 |============================================ GCC 6.2.0 .......... 28383.22 |============================================== GCC 7.0.0 20160904 . 29512.13 |================================================ Clang 3.9.0 ........ 27344.42 |============================================ Clang 3.8.0 ........ 29812.18 |================================================ Hierarchical INTegration 1.0 Test: FLOAT QUIPs > Higher Is Better GCC 5.4.0 .......... 177738053.32 |============================================ GCC 6.2.0 .......... 166219905.04 |========================================= GCC 7.0.0 20160904 . 165733740.33 |========================================= Clang 3.9.0 ........ 143252876.20 |=================================== Clang 3.8.0 ........ 141990405.69 |=================================== Redis 3.0.1 Test: SET Requests Per Second > Higher Is Better GCC 5.4.0 .......... 969029.10 |=============================================== GCC 6.2.0 .......... 972159.31 |=============================================== GCC 7.0.0 20160904 . 965269.60 |=============================================== Clang 3.9.0 ........ 933433.87 |============================================= Clang 3.8.0 ........ 925939.11 |============================================= Redis 3.0.1 Test: GET Requests Per Second > Higher Is Better GCC 5.4.0 .......... 1434042.92 |============================================== GCC 6.2.0 .......... 1408567.41 |============================================= GCC 7.0.0 20160904 . 1393442.96 |============================================= Clang 3.9.0 ........ 1348061.04 |=========================================== Clang 3.8.0 ........ 1342892.96 |=========================================== PostgreSQL pgbench 9.4.3 Scaling: Buffer Test - Test: Single Thread - Mode: Read Write TPS > Higher Is Better GCC 5.4.0 .......... 552.55 |================================================== GCC 6.2.0 .......... 546.21 |================================================= GCC 7.0.0 20160904 . 549.49 |================================================== Clang 3.9.0 ........ 531.79 |================================================ Clang 3.8.0 ........ 538.44 |================================================= PostgreSQL pgbench 9.4.3 Scaling: Buffer Test - Test: Normal Load - Mode: Read Write TPS > Higher Is Better GCC 5.4.0 .......... 4468.82 |================================================= GCC 6.2.0 .......... 4411.75 |================================================ GCC 7.0.0 20160904 . 4437.25 |================================================= Clang 3.9.0 ........ 4356.38 |================================================ Clang 3.8.0 ........ 4411.72 |================================================ OpenSSL 1.0.1g RSA 4096-bit Performance Signs Per Second > Higher Is Better GCC 5.4.0 .......... 569.37 |================================================== GCC 6.2.0 .......... 569.27 |================================================== GCC 7.0.0 20160904 . 570.20 |================================================== Clang 3.9.0 ........ 511.07 |============================================= Clang 3.8.0 ........ 566.80 |================================================== N-Queens 1.0 Elapsed Time Seconds < Lower Is Better GCC 5.4.0 .......... 57.53 |=================================================== GCC 6.2.0 .......... 56.21 |================================================== GCC 7.0.0 20160904 . 52.54 |=============================================== LAME MP3 Encoding 3.99.3 WAV To MP3 Seconds < Lower Is Better GCC 5.4.0 .......... 22.84 |========================================== GCC 6.2.0 .......... 22.42 |========================================== GCC 7.0.0 20160904 . 22.03 |========================================= Clang 3.9.0 ........ 27.46 |=================================================== Clang 3.8.0 ........ 26.94 |================================================== FLAC Audio Encoding 1.3.1 WAV To FLAC Seconds < Lower Is Better GCC 5.4.0 .......... 13.45 |=================================================== GCC 6.2.0 .......... 13.44 |=================================================== GCC 7.0.0 20160904 . 13.45 |=================================================== Clang 3.9.0 ........ 13.15 |================================================== Clang 3.8.0 ........ 13.26 |================================================== Bullet Physics Engine 2.81 Test: 136 Ragdolls Seconds < Lower Is Better GCC 5.4.0 .......... 6.45 |================================================ GCC 6.2.0 .......... 6.46 |================================================= GCC 7.0.0 20160904 . 6.40 |================================================ Clang 3.9.0 ........ 6.92 |==================================================== Clang 3.8.0 ........ 6.89 |==================================================== Bullet Physics Engine 2.81 Test: 3000 Fall Seconds < Lower Is Better GCC 5.4.0 .......... 9.13 |================================================ GCC 6.2.0 .......... 9.11 |================================================ GCC 7.0.0 20160904 . 9.01 |================================================ Clang 3.9.0 ........ 9.83 |==================================================== Clang 3.8.0 ........ 9.57 |=================================================== Bullet Physics Engine 2.81 Test: Raytests Seconds < Lower Is Better GCC 5.4.0 .......... 5.94 |================================================== GCC 6.2.0 .......... 5.98 |================================================== GCC 7.0.0 20160904 . 5.96 |================================================== Clang 3.9.0 ........ 6.21 |==================================================== Clang 3.8.0 ........ 6.20 |==================================================== Smallpt 1.0 Global Illumination Renderer; 100 Samples Seconds < Lower Is Better GCC 5.4.0 .......... 47 |====================================================== GCC 6.2.0 .......... 47 |====================================================== GCC 7.0.0 20160904 . 30 |================================== C-Ray 1.1 Total Time Seconds < Lower Is Better GCC 5.4.0 .......... 21.30 |======================== GCC 6.2.0 .......... 21.25 |======================== GCC 7.0.0 20160904 . 23.36 |=========================== Clang 3.9.0 ........ 44.42 |=================================================== Clang 3.8.0 ........ 39.34 |============================================= Timed PHP Compilation 5.2.9 Time To Compile Seconds < Lower Is Better GCC 5.4.0 .......... 35.31 |================================================= GCC 6.2.0 .......... 36.25 |=================================================== GCC 7.0.0 20160904 . 36.52 |=================================================== Clang 3.9.0 ........ 35.25 |================================================= Clang 3.8.0 ........ 28.45 |======================================== Timed ImageMagick Compilation 6.9.0 Time To Compile Seconds < Lower Is Better GCC 5.4.0 .......... 67.21 |==================================== GCC 6.2.0 .......... 94.51 |=================================================== GCC 7.0.0 20160904 . 81.27 |============================================ Clang 3.9.0 ........ 78.45 |========================================== Clang 3.8.0 ........ 74.34 |======================================== ebizzy 0.3 Phoronix Test Suite v6.6.0 Records/s > Higher Is Better GCC 5.4.0 .......... 155360 |================================================== GCC 6.2.0 .......... 155273 |================================================== GCC 7.0.0 20160904 . 155692 |================================================== Clang 3.9.0 ........ 138671 |============================================= Clang 3.8.0 ........ 152747 |================================================= Himeno Benchmark 3.0 Poisson Pressure Solver MFLOPS > Higher Is Better GCC 5.4.0 .......... 893.82 |======================================== GCC 6.2.0 .......... 1091.32 |================================================= GCC 7.0.0 20160904 . 1095.90 |================================================= Clang 3.9.0 ........ 841.55 |====================================== Clang 3.8.0 ........ 748.09 |================================= SciMark 2.0 Computational Test: Jacobi Successive Over-Relaxation Mflops > Higher Is Better GCC 5.4.0 .......... 571.65 |================================= GCC 6.2.0 .......... 572.05 |================================= GCC 7.0.0 20160904 . 572.06 |================================= Clang 3.9.0 ........ 856.35 |================================================== Clang 3.8.0 ........ 857.42 |================================================== SciMark 2.0 Computational Test: Dense LU Matrix Factorization Mflops > Higher Is Better GCC 5.4.0 .......... 1327.15 |====================== GCC 6.2.0 .......... 1302.74 |====================== GCC 7.0.0 20160904 . 1596.90 |=========================== Clang 3.9.0 ........ 2917.96 |================================================= Clang 3.8.0 ........ 2936.85 |================================================= SciMark 2.0 Computational Test: Sparse Matrix Multiply Mflops > Higher Is Better GCC 5.4.0 .......... 1047.40 |=================================== GCC 6.2.0 .......... 1280.02 |=========================================== GCC 7.0.0 20160904 . 1290.94 |============================================ Clang 3.9.0 ........ 1448.22 |================================================= Clang 3.8.0 ........ 1414.48 |================================================ SciMark 2.0 Computational Test: Fast Fourier Transform Mflops > Higher Is Better GCC 5.4.0 .......... 228.18 |================================================ GCC 6.2.0 .......... 232.19 |================================================= GCC 7.0.0 20160904 . 239.27 |================================================== Clang 3.9.0 ........ 226.01 |=============================================== Clang 3.8.0 ........ 223.71 |=============================================== SciMark 2.0 Computational Test: Monte Carlo Mflops > Higher Is Better GCC 5.4.0 .......... 304.10 |================================================== GCC 6.2.0 .......... 304.07 |================================================== GCC 7.0.0 20160904 . 304.03 |================================================== Clang 3.9.0 ........ 126.43 |===================== Clang 3.8.0 ........ 126.46 |===================== SciMark 2.0 Computational Test: Composite Mflops > Higher Is Better GCC 5.4.0 .......... 695.70 |=============================== GCC 6.2.0 .......... 738.21 |================================ GCC 7.0.0 20160904 . 800.64 |=================================== Clang 3.9.0 ........ 1115.00 |================================================= Clang 3.8.0 ........ 1111.78 |================================================= Fhourstones 3.1 Complex Connect-4 Solving Kpos / sec > Higher Is Better GCC 5.4.0 .......... 6954.67 |================================================ GCC 6.2.0 .......... 6884.93 |=============================================== GCC 7.0.0 20160904 . 6905.30 |=============================================== Clang 3.9.0 ........ 6563.47 |============================================= Clang 3.8.0 ........ 7164.37 |================================================= Timed MAFFT Alignment 6.864 Multiple Sequence Alignment Seconds < Lower Is Better GCC 5.4.0 .......... 5.99 |======================================== GCC 6.2.0 .......... 6.41 |=========================================== GCC 7.0.0 20160904 . 6.45 |=========================================== Clang 3.9.0 ........ 7.27 |================================================= Clang 3.8.0 ........ 7.74 |==================================================== Timed HMMer Search 2.3.2 Pfam Database Search Seconds < Lower Is Better GCC 5.4.0 .......... 12.18 |============================================= GCC 6.2.0 .......... 12.18 |============================================= GCC 7.0.0 20160904 . 12.22 |============================================= Clang 3.9.0 ........ 13.76 |=================================================== Clang 3.8.0 ........ 12.37 |============================================== FFTW 3.3.4 Build: Float + SSE - Size: 2D FFT Size 4096 Mflops > Higher Is Better GCC 5.4.0 .......... 7410.50 |================================================ GCC 6.2.0 .......... 7515.98 |================================================= GCC 7.0.0 20160904 . 7517.94 |================================================= Clang 3.9.0 ........ 6923.64 |============================================= Clang 3.8.0 ........ 6841.34 |============================================= FFTW 3.3.4 Build: Float + SSE - Size: 1D FFT Size 4096 Mflops > Higher Is Better GCC 5.4.0 .......... 10966 |=================================================== GCC 6.2.0 .......... 10936 |=================================================== GCC 7.0.0 20160904 . 10951 |=================================================== Clang 3.9.0 ........ 10331 |================================================ Clang 3.8.0 ........ 10357 |================================================ LAMMPS Molecular Dynamics Simulator 1.0 Test: Rhodopsin Protein Loop Time < Lower Is Better GCC 5.4.0 ... 72.00 |========================================================== Clang 3.9.0 . 62.30 |================================================== Clang 3.8.0 . 63.22 |===================================================