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.

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-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto4080120160200SE +/- 0.00, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.67, N = 399164161141152164163165165-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto1. (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-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto306090120150SE +/- 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 = 35412512810983127126140140-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto1. (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-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto4080120160200SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.58, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.33, N = 3100192192187174191192198198-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto1. (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-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto50100150200250SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3SE +/- 0.33, N = 3SE +/- 0.58, N = 3SE +/- 0.33, N = 3SE +/- 0.33, N = 3SE +/- 0.00, N = 3127215213215209212224213213-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto1. (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-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto20406080100SE +/- 0.00, N = 3SE +/- 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 = 320969778639797102102-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto1. (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-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto400800120016002000SE +/- 0.41, N = 3SE +/- 4.67, N = 3SE +/- 3.26, N = 3SE +/- 1.98, N = 3SE +/- 2.41, N = 3SE +/- 2.65, N = 3SE +/- 0.48, N = 3SE +/- 1.54, N = 3SE +/- 1.57, N = 3479.711158.411919.661250.491240.971958.101960.561827.551825.39-O0-O1-O2-Os-Og-Ofast-march=native-march=native -flto1. (CC) gcc options: -O3

Timed Apache Compilation

Time To Compile

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

Timed ImageMagick Compilation

Time To Compile

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

Timed PHP Compilation

Time To Compile

OpenBenchmarking.orgSeconds, Fewer Is BetterTimed PHP Compilation 5.2.9Time To Compile-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto20406080100SE +/- 0.01, N = 3SE +/- 0.10, N = 3SE +/- 0.04, N = 3SE +/- 0.35, N = 3SE +/- 0.01, N = 3SE +/- 0.01, N = 3SE +/- 0.08, N = 3SE +/- 0.04, N = 3SE +/- 0.22, N = 310.2117.1622.9620.2414.9526.2226.3027.0195.96-O1-O2-Os-Og-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-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto1530456075SE +/- 0.03, N = 3SE +/- 0.02, N = 3SE +/- 0.01, N = 3SE +/- 0.01, N = 3SE +/- 0.00, N = 3SE +/- 0.02, N = 3SE +/- 0.01, N = 3SE +/- 0.00, N = 3SE +/- 0.00, N = 363.9344.2340.4265.7643.3522.8222.6517.0917.09-O0-O1-O2-Os-Og-Ofast-march=native-march=native -flto1. (CC) gcc options: -lm -lpthread -O3

FLAC Audio Encoding

WAV To FLAC

OpenBenchmarking.orgSeconds, Fewer Is BetterFLAC Audio Encoding 1.3.0WAV To FLAC-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto510152025SE +/- 0.01, N = 5SE +/- 0.03, N = 5SE +/- 0.00, N = 5SE +/- 0.01, N = 5SE +/- 0.00, N = 5SE +/- 0.00, N = 5SE +/- 0.00, N = 5SE +/- 0.00, N = 5SE +/- 0.00, N = 519.855.565.375.966.144.634.523.613.62-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto1. (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-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto816243240SE +/- 0.01, N = 5SE +/- 0.01, N = 5SE +/- 0.02, N = 5SE +/- 0.01, N = 5SE +/- 0.01, N = 5SE +/- 0.01, N = 5SE +/- 0.03, N = 5SE +/- 0.01, N = 5SE +/- 0.01, N = 533.1215.0112.5414.2015.5511.8311.4910.8710.87-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto1. (CC) gcc options: -pipe -lm

Hierarchical INTegration

Test: FLOAT

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


Phoronix Test Suite v10.8.4