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&grr.

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 Tuninghint: FLOATencode-mp3: WAV To MP3encode-flac: WAV To FLACc-ray: Total Timebuild-php: Time To Compilebuild-imagemagick: Time To Compilebuild-apache: Time To Compilehimeno: Poisson Pressure Solvergraphics-magick: Local Adaptive Thresholdinggraphics-magick: HWB Color Spacegraphics-magick: Resizinggraphics-magick: Sharpengraphics-magick: Blur-O0-O1-O2-Os-Og-O3-Ofast-O3 -march=native-O3 -march=native -flto113640165.4333.1219.8563.9310.2116.7013.63479.71201271005499272724038.5615.015.5644.2317.1632.3119.421158.4196215192125164357045741.7312.545.3740.4222.9647.3824.661919.6697213192128161338799356.9714.205.9665.7620.2440.8223.081250.4978215187109141276760433.2815.556.1443.3514.9526.0817.701240.976320917483152353630824.7511.834.6322.8226.2259.0727.321958.1097212191127164372135723.1611.494.5222.6526.3027.391960.5697224192126163373780357.4610.873.6117.0927.0160.9027.831827.55102213198140165372669017.1710.873.6217.0995.96130.2945.491825.39102213198140165OpenBenchmarking.org

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

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

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

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

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

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 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

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

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

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: 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: 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: 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


Phoronix Test Suite v10.8.4