GCC 4.9.0 Compiler Optimization Tuning

Testing various CFLAGS/CXXFLAGS of different GCC compiler optimizations including the -O optimization levels, Link Time Optimizations, and -march=native targeting. benchmarks by Michael Larabel for a future article on phoronix.com

HTML result view exported from: https://openbenchmarking.org/result/1404130-KH-GCC490COM36&sor.

GCC 4.9.0 Compiler Optimization TuningProcessorMotherboardChipsetMemoryDiskGraphicsAudioMonitorNetworkOSKernelDesktopDisplay ServerDisplay DriverOpenGLCompilerFile-SystemScreen Resolution-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -fltoIntel Core i7-4770K @ 3.50GHz (8 Cores)ECS Z87H3-A2X EXTREME v1.0Intel 4th Gen Core DRAM16384MB120GB Samsung SSD 840ECS NVIDIA GeForce GTX 460 768MB (675/1804MHz)Realtek ALC1150Samsung SyncMasterRealtek RTL8111/8168/8411Ubuntu 14.043.13.0-22-generic (x86_64)Unity 7.2.0X Server 1.15.0NVIDIA 337.124.3.0GCC 4.9.0 20140411ext42560x1600OpenBenchmarking.orgCompiler Details- --enable-checking=releaseProcessor Details- Scaling Governor: acpi-cpufreq ondemand

GCC 4.9.0 Compiler Optimization Tuninggraphics-magick: Blurgraphics-magick: Sharpengraphics-magick: Resizinggraphics-magick: HWB Color Spacegraphics-magick: Local Adaptive Thresholdinghimeno: Poisson Pressure Solverbuild-apache: Time To Compilebuild-imagemagick: Time To Compilebuild-php: Time To Compilec-ray: Total Timeencode-flac: WAV To FLACencode-mp3: WAV To MP3hint: FLOAT-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto995410012720479.7113.6316.7010.2163.9319.8533.12113640165.43164125192215961158.4119.4232.3117.1644.235.5615.01272724038.56161128192213971919.6624.6647.3822.9640.425.3712.54357045741.73141109187215781250.4923.0840.8220.2465.765.9614.20338799356.9715283174209631240.9717.7026.0814.9543.356.1415.55276760433.28164127191212971958.1027.3259.0726.2222.824.6311.83353630824.75163126192224971960.5627.3926.3022.654.5211.49372135723.161651401982131021827.5527.8360.9027.0117.093.6110.87373780357.461651401982131021825.3945.49130.2995.9617.093.6210.87372669017.17OpenBenchmarking.org

GraphicsMagick

Operation: Blur

OpenBenchmarking.orgIterations Per Minute, More Is BetterGraphicsMagick 1.3.19Operation: Blur-O3 -march=native -flto-O3 -march=native-O3-O1-Ofast-O2-Og-Os-O04080120160200SE +/- 0.67, N = 3SE +/- 0.33, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 316516516416416316115214199-O3 -march=native -flto-O3 -march=native-O3-O1-Ofast-O2-Og-Os-O01. (CC) gcc options: -std=gnu99 -fopenmp -pthread -ljbig -lwebp -ljpeg -lXext -lX11 -llzma -lxml2 -lz -lm -lpthread

GraphicsMagick

Operation: Sharpen

OpenBenchmarking.orgIterations Per Minute, More Is BetterGraphicsMagick 1.3.19Operation: Sharpen-O3 -march=native -flto-O3 -march=native-O2-O3-Ofast-O1-Os-Og-O0306090120150SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 31401401281271261251098354-O3 -march=native -flto-O3 -march=native-O2-O3-Ofast-O1-Os-Og-O01. (CC) gcc options: -std=gnu99 -fopenmp -pthread -ljbig -lwebp -ljpeg -lXext -lX11 -llzma -lxml2 -lz -lm -lpthread

GraphicsMagick

Operation: Resizing

OpenBenchmarking.orgIterations Per Minute, More Is BetterGraphicsMagick 1.3.19Operation: Resizing-O3 -march=native -flto-O3 -march=native-Ofast-O2-O1-O3-Os-Og-O04080120160200SE +/- 0.33, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.33, N = 3SE +/- 0.33, N = 3SE +/- 0.58, N = 3SE +/- 0.00, N = 3198198192192192191187174100-O3 -march=native -flto-O3 -march=native-Ofast-O2-O1-O3-Os-Og-O01. (CC) gcc options: -std=gnu99 -fopenmp -pthread -ljbig -lwebp -ljpeg -lXext -lX11 -llzma -lxml2 -lz -lm -lpthread

GraphicsMagick

Operation: HWB Color Space

OpenBenchmarking.orgIterations Per Minute, More Is BetterGraphicsMagick 1.3.19Operation: HWB Color Space-Ofast-Os-O1-O3 -march=native -flto-O3 -march=native-O2-O3-Og-O050100150200250SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.33, N = 3SE +/- 0.58, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3224215215213213213212209127-Ofast-Os-O1-O3 -march=native -flto-O3 -march=native-O2-O3-Og-O01. (CC) gcc options: -std=gnu99 -fopenmp -pthread -ljbig -lwebp -ljpeg -lXext -lX11 -llzma -lxml2 -lz -lm -lpthread

GraphicsMagick

Operation: Local Adaptive Thresholding

OpenBenchmarking.orgIterations Per Minute, More Is BetterGraphicsMagick 1.3.19Operation: Local Adaptive Thresholding-O3 -march=native -flto-O3 -march=native-Ofast-O3-O2-O1-Os-Og-O020406080100SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 310210297979796786320-O3 -march=native -flto-O3 -march=native-Ofast-O3-O2-O1-Os-Og-O01. (CC) gcc options: -std=gnu99 -fopenmp -pthread -ljbig -lwebp -ljpeg -lXext -lX11 -llzma -lxml2 -lz -lm -lpthread

Himeno Benchmark

Poisson Pressure Solver

OpenBenchmarking.orgMFLOPS, More Is BetterHimeno Benchmark 3.0Poisson Pressure Solver-Ofast-O3-O2-O3 -march=native-O3 -march=native -flto-Os-Og-O1-O0400800120016002000SE +/- 0.48, N = 3SE +/- 2.65, N = 3SE +/- 3.26, N = 3SE +/- 1.54, N = 3SE +/- 1.57, N = 3SE +/- 1.98, N = 3SE +/- 2.41, N = 3SE +/- 4.67, N = 3SE +/- 0.41, N = 31960.561958.101919.661827.551825.391250.491240.971158.41479.71-Ofast-O2-march=native-march=native -flto-Os-Og-O1-O01. (CC) gcc options: -O3

Timed Apache Compilation

Time To Compile

OpenBenchmarking.orgSeconds, Fewer Is BetterTimed Apache Compilation 2.4.7Time To Compile-O0-Og-O1-Os-O2-O3-Ofast-O3 -march=native-O3 -march=native -flto1020304050SE +/- 0.03, N = 3SE +/- 0.02, N = 3SE +/- 0.04, N = 3SE +/- 0.09, N = 3SE +/- 0.14, N = 3SE +/- 0.07, N = 3SE +/- 0.11, N = 3SE +/- 0.03, N = 3SE +/- 0.11, N = 313.6317.7019.4223.0824.6627.3227.3927.8345.49

Timed ImageMagick Compilation

Time To Compile

OpenBenchmarking.orgSeconds, Fewer Is BetterTimed ImageMagick Compilation 6.8.1-10Time To Compile-O0-Og-O1-Os-O2-O3-O3 -march=native-O3 -march=native -flto306090120150SE +/- 0.10, N = 3SE +/- 0.11, N = 3SE +/- 0.19, N = 3SE +/- 0.05, N = 3SE +/- 0.15, N = 3SE +/- 0.14, N = 3SE +/- 0.65, N = 3SE +/- 0.30, N = 316.7026.0832.3140.8247.3859.0760.90130.29

Timed PHP Compilation

Time To Compile

OpenBenchmarking.orgSeconds, Fewer Is BetterTimed PHP Compilation 5.2.9Time To Compile-O0-Og-O1-Os-O2-O3-Ofast-O3 -march=native-O3 -march=native -flto20406080100SE +/- 0.01, N = 3SE +/- 0.01, N = 3SE +/- 0.10, N = 3SE +/- 0.35, N = 3SE +/- 0.04, N = 3SE +/- 0.01, N = 3SE +/- 0.08, N = 3SE +/- 0.04, N = 3SE +/- 0.22, N = 310.2114.9517.1620.2422.9626.2226.3027.0195.96-Og-O1-Os-O2-O3-Ofast-O3 -march=native-O3 -march=native -flto1. (CC) gcc options: -pedantic -ldl -lz -lm

C-Ray

Total Time

OpenBenchmarking.orgSeconds, Fewer Is BetterC-Ray 1.1Total Time-O3 -march=native-O3 -march=native -flto-Ofast-O3-O2-Og-O1-O0-Os1530456075SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.01, N = 3SE +/- 0.02, N = 3SE +/- 0.01, N = 3SE +/- 0.00, N = 3SE +/- 0.02, N = 3SE +/- 0.03, N = 3SE +/- 0.01, N = 317.0917.0922.6522.8240.4243.3544.2363.9365.76-march=native-march=native -flto-Ofast-O2-Og-O1-O0-Os1. (CC) gcc options: -lm -lpthread -O3

FLAC Audio Encoding

WAV To FLAC

OpenBenchmarking.orgSeconds, Fewer Is BetterFLAC Audio Encoding 1.3.0WAV To FLAC-O3 -march=native-O3 -march=native -flto-Ofast-O3-O2-O1-Os-Og-O0510152025SE +/- 0.00, N = 5SE +/- 0.00, N = 5SE +/- 0.00, N = 5SE +/- 0.00, N = 5SE +/- 0.00, N = 5SE +/- 0.03, N = 5SE +/- 0.01, N = 5SE +/- 0.00, N = 5SE +/- 0.01, N = 53.613.624.524.635.375.565.966.1419.85-O3 -march=native-O3 -march=native -flto-Ofast-O3-O2-O1-Os-Og-O01. (CXX) g++ options: -fvisibility=hidden -logg -lm

LAME MP3 Encoding

WAV To MP3

OpenBenchmarking.orgSeconds, Fewer Is BetterLAME MP3 Encoding 3.99.3WAV To MP3-O3 -march=native-O3 -march=native -flto-Ofast-O3-O2-Os-O1-Og-O0816243240SE +/- 0.01, N = 5SE +/- 0.01, N = 5SE +/- 0.03, N = 5SE +/- 0.01, N = 5SE +/- 0.02, N = 5SE +/- 0.01, N = 5SE +/- 0.01, N = 5SE +/- 0.01, N = 5SE +/- 0.01, N = 510.8710.8711.4911.8312.5414.2015.0115.5533.12-O3 -march=native-O3 -march=native -flto-Ofast-O3-O2-Os-O1-Og-O01. (CC) gcc options: -pipe -lm

Hierarchical INTegration

Test: FLOAT

OpenBenchmarking.orgQUIPs, More Is BetterHierarchical INTegration 1.0Test: FLOAT-O3 -march=native-O3 -march=native -flto-Ofast-O2-O3-Os-Og-O1-O080M160M240M320M400MSE +/- 224417.18, N = 3SE +/- 330651.20, N = 3SE +/- 825976.11, N = 3SE +/- 438886.50, N = 3SE +/- 189770.59, N = 3SE +/- 162740.51, N = 3SE +/- 175429.79, N = 3SE +/- 232620.63, N = 3SE +/- 47999.17, N = 3373780357.46372669017.17372135723.16357045741.73353630824.75338799356.97276760433.28272724038.56113640165.43-O3 -march=native-O3 -march=native -flto-Ofast-O2-O3-Os-Og-O1-O01. (CC) gcc options: -lm


Phoronix Test Suite v10.8.4