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

Optimizing Mesa Performance With Compiler Flags

Mesa

Published on 27 January 2013 09:00 PM EST
Written by Michael Larabel in Mesa
24 Comments

Compiler tuning can lead to performance improvements for many computational benchmarks by toying with the CFLAGS/CXXFLAGS, but is there much gain out of optimizing your Mesa build? Here's some benchmark results.

On Thursday for the Intel Mesa DRI driver was a new patch by Intel's Eric Anholt for attempting to default the driver compilation process to using -march=core2. This change is mainly to benefit 32-bit systems where SSE support can't be assumed by default, but with the i965 driver, more often than not it can be assumed an Intel Core 2 processor or newer is in use. (The older Intel processors are generally using the i915 driver.) By setting the -march=core2 flag, for i386 builds SSE would now be used for floating-point math and cmov instructions, plus other performance optimizations.

Eric noted that for 32-bit builds, the GLbenchmark offscreen performance went up by about 0.76% by defaulting to the Core2 optimizations. This patch was ultimately rejected since it turns out there's still some old Pentium 4s that could be found in an i965 driver configuration where things might break.

Curious to see what other performance changes could come from some basic compiler tuning, I did some Mesa benchmarks this weekend. This is on a high-end Ivy Bridge system and using x86_64 software, but was inspired by seeing Eric's patch earlier in the week. This is just some weekend benchmarking out of curiosity, although the drivers should be ideal where they are not CPU bottlenecked, but past testing has shown this isn't always the case for the Mesa/Gallium3D drivers.

By default, Mesa doesn't toy with the -march switch and it uses an -O2 optimization level. In this article, are benchmarks of -O1, -O2, -O3, and then -O3 while also passing -march=native. The -march=native will apply the CPU micro-architecture optimizations for the Intel Core i7 "Ivy Bridge" processor being used. GCC Link-Time Optimizations were also tested. While GCC 4.7.2 built out Mesa and glxinfo was still querying information correctly from the newly-built Mesa stack with LTO, when it came to running any OpenGL games/applications, they failed with the GCC LTO build.

The Intel HD 4000 graphics were then used with these different Mesa 9.1-devel builds for a variety of benchmarks from an Ubuntu 13.04 desktop paired with the Linux 3.8 kernel. Results in full, system logs, and other details are on OpenBenchmarking.org in the 1301279-FO-MESACOMPI30 result file.

Overall though, there wasn't much in the way of exciting performance changes... For the Intel HD 4000 graphics on Mesa 9.1-devel with the different CFLAGS/CXXFLAGS, the compile-time changes didn't yield much difference in the end for the OpenGL frame-rate.

Nexuiz was the only case where there was a significant difference as a result of the optimization level, but that is a difference of just a couple frames.

The Prey game, which is powered by id Tech 4, didn't even get any rise out of the Ivy Bridge optimizations or -O3 optimization level from GCC 4.7.2.

For those interested, more of these Mesa 9.1-devel benchmark results can be found on OpenBenchnarking.org.

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 Articles & Reviews
  1. Samsung 850 EVO SSD Linux Benchmarks
  2. Kubuntu 15.04 Is Turning Out Quite Nice, Good Way To Try Out The Latest KDE
  3. 5-Way Linux Distribution Comparison On The Core i3 NUC
  4. OCZ ARC 100 Linux SSD Benchmarks
  5. Lenovo ThinkPad X1 Carbon Works Great As A Linux Ultrabook
  6. Transcend SSD370 256GB
Latest Linux News
  1. Qt 5.5 Alpha Is Getting Close, But Still Behind Schedule
  2. OpenBSD Sponsors Work For Better Browser Security
  3. Improved ODF Reading Support Comes To KDE's Calligra
  4. Another Step Closer On The New Linux Benchmarking Test Farm
  5. Confirmed: Vulkan Is The Next-Gen Graphics API
  6. Kdenlive Ported To Qt5/KF5, Coming To KDE Applications 15.04
  7. HTC & Valve Partnered Up For The Steam VR Headset
  8. 8cc: A Small C11 Compiler
  9. Not Everyone Likes The Possible "VULKAN" Name For Next-Gen OpenGL
  10. The Binary Blobs Making Up Coreboot
Most Viewed News This Week
  1. Screenshots Of The GNOME 3.16 Changes
  2. More Proof That Allwinner Is Violating The GPL
  3. The Tremendous Features Of Fedora 22
  4. Krita 2.9 Released, Their Biggest Release Ever
  5. A Single UEFI Executable With The Linux Kernel, Initrd & Command Line
  6. Linux 4.0 Doesn't Have The Weirdest Codename
  7. Canonical Comes Up With Its Own FUSE Filesystem For Linux Containers
  8. Firefox 36 Brings Full HTTP/2 Support
%%CLICK_URL_UNESC%%