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. Preview: AMD's FX-9590 Eight-Core At Up To 5.0GHz On Linux
  2. Intel Launches The Core i7 5960X, Mighty Powerful Haswell-E CPUs
  3. AMD Radeon R9 290: Gallium3D vs. Catalyst Drivers
  4. AMD Radeon R9 290 Open-Source Driver Works, But Has A Ways To Go
Latest Linux Articles
  1. How Intel Graphics On Linux Compare To Open-Source AMD/NVIDIA Drivers
  2. The Fastest NVIDIA GPUs For Open-Source Nouveau With Steam Linux Gaming
  3. Testing For The Latest Linux Kernel Power Regression
  4. The Most Energy Efficient Radeon GPU For AMD Linux Gaming
Latest Linux News
  1. Nouveau X.Org Driver Released With DRI3+Present, Maxwell, GLAMOR
  2. Microsoft & AMD Release C++ AMP Compiler With Linux Support
  3. AMD, Wine & Valve Dominated August For Linux Users
  4. Linux 3.17-rc3 Kernel Released Back On Schedule
  5. Lennart Poettering Talks Up His New Linux Vision That Involves Btrfs
  6. Mesa 10.3 RC2 Arrives Via Its New Release Manager
  7. Ubuntu 14.10's Lack Of X.Org Server 1.16 Gets Blamed On AMD
  8. MSI Motherboard BIOS Updating Remains A Pain For Linux Users
  9. See How Your Linux System Performs Against The Latest Intel/AMD CPUs
  10. AMD Steppe Eagle Flys To Coreboot
Latest Forum Discussions
  1. Lennart Poettering Talks Up His New Linux Vision That Involves Btrfs
  2. The dangers of Linux kernel development
  3. Updated and Optimized Ubuntu Free Graphics Drivers
  4. AMD Releases UVD Video Decode Support For R600 GPUs
  5. SSD seems slow
  6. Is laptop with Intel CPU and AMD dGPU worth buying considering especially AMD Enduro?
  7. Radeon HD5670 and Ubuntu 14.04
  8. Btrfs Gets Talked Up, Googler Encourages You To Try Btrfs