1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

Link-Time Optimizing Improved, But Still Takes A While On GCC 4.9

Compiler

Published on 13 April 2014 10:58 AM EDT
Written by Michael Larabel in Compiler
11 Comments

The GCC 4.9 compiler that's about to be released has many improvements, including in the area of LTO (Link-Time Optimizations), but you must still have a fair amount of patience to compile with LTO support.

Link-Time Optimizations are optimizations done by the compiler at link-time, when interprocedural optimizations can be applied against the entire code-base as a whole of what's being compiled rather than just the scope of a single source file being compiled at a time. With the compiler being able to analyze the complete program, greater optimizations can be applied for eliminating unneeded code and yielding various performance optimizations, but at the cost of a slower compilation process and generally with much more system memory required.

Link-Time Optimization improvements to be found in GCC 4.9.0 include rewritten type-merging that is faster and uses less memory, a more efficient partitioning algorithm, early removal of virtual methods, on-demand function body loading and releasing, optimizing out C++ hidden keyed methods, and other improvements. GCC developers have sighted that Mozilla Firefox in doing an LTO build on GCC 4.9 now just takes 350 seconds compared to 1700 seconds in the past and the memory usage drops a lot from 15GB to 3.5GB.

Link-Time Optimizing Improved, But Still Takes A While On GCC 4.9

Given all the talk lately about LTO'ing the Linux kernel and that it might soon become a reality for the mainline Linux kernel (and on a different but related note that Clang should soon be able to compile the mainline Linux kernel), I ran some LTO compiler tests this weekend on the brand new GCC 4.9.0 RC1 release. I also compared the LTO and non-LTO of GCC 4.9.0 RC1 against GCC 4.8.2 stable, when both were built fresh from mainline source and configured the same at build-time.

The results of the generated binaries weren't too interesting in this quick weekend benchmarking at Phoronix as I had just passed a variety of (random source-based) OpenBenchmarking.org test profiles to the Phoronix Test Suite. With many benchmarks commonly being comprised of a single C/C++ source-file, there isn't anything to gain from LTO. However, perhaps the most interesting part of this testing was to look at the compilation times of the few build-* test profiles when using the LTO mode (by passing the -flto switch to the CFLAGS/CXXFLAGS).

The Apache compilation process didn't change much in general between GCC 4.8.2 and 4.9.0 RC1 with or without LTO. Enabling link-time optimizations added about 64% onto the compilation time. (The system_monitor module of the Phoronix Test Suite wasn't enabled during this testing so there aren't any RAM measurements to share for this quick, one-page article.)


Compiling ImageMagick with LTO still about doubles the compilation process time on GCC 4.9.


Compiling PHP with Link-Time Optimizations is one of the tough cases where the compilation process is dragged out by more than three times.

Those wanting to checkout this other quick, weekend GCC 4.9 LTO testing can see 1404126-PTS-GCC4849L62 for the system hardware/software details, etc, but again the performance of the generated binaries wasn't too interesting for this round of brief testing with the random selection of open-source benchmarks chosen -- some of which really aren't relevant to LTO. Stay tuned for more exhaustive GCC 4.9 benchmarking in the days and weeks ahead with the 4.9.0 release expected to be christened in the week following Easter.

About The Author
Michael Larabel is the principal author of Phoronix.com and founded the web-site in 2004 with a focus on enriching the Linux hardware experience and being the largest web-site devoted to Linux hardware reviews, particularly for products relevant to Linux gamers and enthusiasts but also commonly reviewing servers/workstations and embedded Linux devices. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics hardware drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated testing software. He can be followed via and or contacted via .
Latest Linux Hardware Reviews
  1. Intel Launches The Core i7 5960X, Mighty Powerful Haswell-E CPUs
  2. AMD Radeon R9 290: Gallium3D vs. Catalyst Drivers
  3. AMD Radeon R9 290 Open-Source Driver Works, But Has A Ways To Go
  4. Trying The Configurable 45 Watt TDP With AMD's A10-7800 / A6-7400K
Latest Linux Articles
  1. Testing For The Latest Linux Kernel Power Regression
  2. The Most Energy Efficient Radeon GPU For AMD Linux Gaming
  3. 20-Way Radeon Comparison With Open-Source Graphics For Steam On Linux Gaming
  4. Preview: OS X 10.10 Yosemite vs. Ubuntu Linux GPU Performance
Latest Linux News
  1. Enlightenment E19 RC3 Shows Off The New Wayland Compositor
  2. Metro Redux Is Going To Require OpenGL 4.x On Linux
  3. Jailhouse v0.1 Released As A Basic Hypervisor For Linux
  4. Google's Chromebook "Samus" Now Supported By Coreboot
  5. Chrome 38 Now In Beta With Exciting Advancements
  6. Ubuntu's Utopic Unicorn 14.10 Beta 1 Released
  7. Genode OS 14.08 Has New GUI Architecture, Pluggable VFS
  8. Another Intel Linux Power Regression Is Being Investigated
  9. DNF Makes It A Step Closer To Replacing Yum On Fedora
  10. OS Battle: Linux Takes 1.7% Desktop Marketshare
Latest Forum Discussions
  1. Canonical Joined The Khronos Group To Help Mir/Wayland Drivers
  2. Users defect to Linux as OpenBSD removes Lynx from base system
  3. Radeon HD5670 and Ubuntu 14.04
  4. Updated and Optimized Ubuntu Free Graphics Drivers
  5. AMD Releases UVD Video Decode Support For R600 GPUs
  6. Best Radeon for a Power Mac G5?
  7. OC capability - Intel Core i5 4690K & Biostar Hi-Fi Z97WE
  8. Announcing radeontop, a tool for viewing the GPU usage