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. Even With Re-Clocking, Nouveau Remains Behind NVIDIA's Proprietary Linux Driver
  2. The Power Consumption & Efficiency Of Open-Source GPU Drivers
  3. AMD R600g/RadeonSI Performance On Linux 3.16 With Mesa 10.3-devel
  4. Intel Pentium G3258 On Linux
Latest Linux Articles
  1. AMD Catalyst 14.6 Does Slightly Better With APITest OpenGL Tests
  2. Updated Source Engine Benchmarks On The Latest AMD/NVIDIA Linux Drivers
  3. Nouveau vs. Radeon vs. Intel Tests On Linux 3.16, Mesa 10.3-devel
  4. KVM Benchmarks On Ubuntu 14.10
Latest Linux News
  1. KDE 4.14 Release Candidate Ships
  2. Drivers & Drama Dominated Linux Talk In July
  3. Fedora Assembles A Security Team
  4. AMD Launches The A10-7800, The 65 Watt Kaveri
  5. Builder: A New Development IDE Being Built For GNOME
  6. GDB 7.8 Betters Python Scripting, Adds Guile Support
  7. GNOME's GTK+ Is Still Striving For A Scene Graph, Canvas API
  8. Unreal Tournament Looks Great For Team Deathmatch
  9. LibreOffice 4.3 Released With Many Exciting Changes
  10. GNOME/GTK On Wayland Gains Focus At GUADEC
Latest Forum Discussions
  1. Linus Torvalds On GCC 4.9: Pure & Utter Crap
  2. Grand Theft Auto Running On Direct3D Natively On Linux Shows Gallium3D Potential
  3. Debian + radeonsi
  4. AMD Publishes Open-Source Linux HSA Kernel Driver
  5. Open-source drivers on ATI R7 260X
  6. AMD Athlon 5350 APU On Linux
  7. Updated and Optimized Ubuntu Free Graphics Drivers
  8. List of Linux friendly Kickstarter projects