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. A Walkthrough Of The New 32 System Open-Source Linux Benchmarking Test Farm
  2. Habey MITX-6771: Mini-ITX Board With Quad-Core J1900 Bay Trail
  3. OCZ Vector 150 SSD On Linux
  4. Noctua i4 CPU Cooler: Great For Cooling High-End LGA-2011v3 CPUs
Latest Linux Articles
  1. AMD Kaveri: Open-Source Radeon Gallium3D vs. Catalyst 14.12 Omega Driver
  2. 12-Way AMD Catalyst 14.12 vs. NVIDIA 346 Series Linux GPU Comparison
  3. AMD Catalyst 14.12 Omega Driver Brings Mixed Results For Linux Users
  4. 6-Way Winter 2014 Linux Distribution Comparison
Latest Linux News
  1. Opera Browser Puts Out Linux Updates For The Holidays
  2. GNOME Shell 3.15.3 Adds Support For High-Contrast Themes
  3. Linux 3.19: ThinkPad Muting Redone, New Dell Backlight Support, Acer Is Banging
  4. KVM Drops Support For IA64 While Adding Various x86 Improvements
  5. GCC 4.8.4 Officially Released
  6. FSF's High Priority Project List Now Has A Committee
  7. Details On Using OpenACC & GPUs With GCC
  8. Ubuntu 15.04 Alpha 1 For Its Various Flavors
  9. Git 2.2.1 Released To Fix Critical Security Issue
  10. WTFTW: A Tiling Window Manager Written In Rust
Latest Forum Discussions
  1. XLennart: A Game For Systemd Haters With Nothing Better To Do
  2. The New SuperTuxKart Looks Better, But Can Cause GPU/Driver Problems
  3. Debian init discussion in Phoenix Wright format
  4. FPS capped on Linux (AMD fglrx drivers)
  5. Are there an app using HSA ?
  6. Bench specific mount point
  7. Tool for measuring FPS in games
  8. Need some hand holding with upgrading xserver