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. Scythe Mugen MAX
  2. Intel Core i7 5960X Haswell-E On Linux
  3. Intel 80GB 530 Series M.2 SSD On Linux
  4. With A New Motherboard, The Core i7 5960X Haswell-E Lights Up
Latest Linux Articles
  1. 7-Way Linux Desktop Gaming Comparison On Ubuntu 14.10
  2. Intel P-State vs. CPUFreq Benchmarks On The i7-5960X
  3. RadeonSI GLAMOR Benchmarks With X.Org Server 1.16
  4. RadeonSI Gallium3D vs. Catalyst At 4K UHD On Linux
Latest Linux News
  1. Mesa Gets Closer To Having OpenGL 4.0 Tessellation Support
  2. Uselessd: A Stripped Down Version Of Systemd
  3. F2FS Tools Gain FSCK Support
  4. FreeBSD 10.1 Has The New VT Driver, Hardware Improvements
  5. AntiMicro 2.6 Yields Greater Compatibility For Gamepads On Linux
  6. OpenGL 3.3 / GLSL 3.30 Lands For Intel Sandy Bridge On Mesa
  7. AMD's RadeonSI Gallium3D Driver Sees Some Improvements
  8. Mesa 10.3 Released With The Latest Open-Source GPU Driver Improvements
  9. GNOME 3.13.92 Officially Released
  10. Wine 1.7.27 Is Still Working Towards Direct2D Support
Latest Forum Discussions
  1. Can Linux kill a motherboard?
  2. Wasteland 2 Officially Launched Today, Including For Linux Gamers
  3. X.Org Women Outreach Program Only Turns Up Two Applicants So Far
  4. New stress testing utility for GPU's
  5. Stop grabbing my keyboard :(
  6. New Group Calls For Boycotting Systemd
  7. SSD seems slow
  8. R. Tyler restarts work on FreeBSD launchd port, openlaunchd