C Optimization, Pentium 4, 4 May 2004, tree-ssa/3.5/3.4/icc

Scott Robert Ladd coyote@coyotegulch.com
Tue May 4 14:17:00 GMT 2004


Hello,

New this time around:
     Use of -D__NO_MATH_INLINES and -D__NO_STRING_INLINES switches
     New arithmetic coding benchmark
     Separation of Pentium 4 and Opteron results
     Durations of some tests have been adjusted

I've compared the speed of code generated by recent versions of GCC,
using a beta version of a C benchmark suite that I'm developing. The
benchmark suite is currently comprised of eight separate tests, each of
which times its inner loop and reports the result to a driver program.

In the following tables, times are in seconds, as computed for the inner
loop being tested. The benchmarks are described at the end of this message.

Intel ia32/Pentium 4 Northwood 2.8GHz w/HT enabled
Debian 32-bit Linux 2.6.5
GCC options: -O3 -ffast-math -march=pentium4
                  -D__NO_MATH_INLINES -D__NO_STRING_INLINES
ICC options: -O3 -xN -ipo

test  tree-ssa  mainline    3.4.1    ICC 8.0
----  --------  --------  --------  --------
alma    67.4      67.9      18.9      22.0
arco    25.4      26.1      26.1      20.8
  evo    52.8      53.4      53.2      37.9
  fft    32.0      32.0      32.1      34.5
huff    17.9      23.6      22.2      16.7
  lin    22.5      21.2      21.5      21.3
mat1     7.7       7.7       7.6       7.6
mole    75.2      73.9      75.6      12.1
tree    25.3      29.1      24.8      27.5
----  --------  --------  --------  --------
total  326.3     334.9     282.1     200.3

I include the Intel C compiler (ICC) for comparison purposes, and
because so many people ask about it.


ANALYSIS

Congratulations! Tree-ssa now beats ICC on the infamous "alma" 
benchmark. Good stuff.

While mainline shows little improvement over 3.4, tree-ssa looks very 
good due to it's performance on "alma". GCC is obviously missing 
something on the "mole" benchmark, given Intel's excellent performance 
on that benchmark.

USUAL DISCLAIMER AND EXPLANATION STUFF:

The benchmark suite is *not* complete; I will be adding at least one
more test, along with better automated reporting facilities. If you
would like a copy of the benchmark suite, please request it from me by
e-mail, as it's not ready for general distribution.

I am *not* testing compilation speed.

Most users will compile with the highest optimization level possible
under the assumption that it will produce the fastest code. Additional
options (e.g. -funroll-loops) may improve generated code speed; in fact,
it is almost always possible to find a "-O1 and other options" set that
produces faster code than -O3 (see my Acovea articles). HOWEVER, in this
comparison, I'm looking at how general users are going to use the tool
at hand.

All GNU compilers were taken from anonymous CVS on 2004-05-03, and built
using:

     --enable-shared
     --enable-threads=posix
     --enable-__cxa_atexit
     --disable-checking
     --disable-multilib (Opteron only)


BENCHMARKS

A short description of the benchmarks:

alma -- Calculates the daily ephemeris (at noon) for the years
2000-2099; tests array handling, floating-point math, and mathematical
functions such as sin() and cos().

arco -- Implements simple arithmetic encoding and decoding, testing bit 
manipulation, loop optimization, and integer math.

evo -- A simple genetic algorithm that maximizes a two-dimensional
function; tests 64-bit math, loop generation, and floating-point math.

fft -- Uses a Fast Fourier Transform to multiply two very (very) large
polynomials; tests the C99 _Complex type and basic floating-point math.

huff -- Compresses a large block of data using the Huffman algorithm;
tests string manipulation, bit twiddling, and the use of large memory
blocks.

lin -- Solves a large linear equation via LUP decomposition; tests basic
floating-point math, two-dimensional array performance, and loop
optimization.

mat1 -- Multiplies two very large matrices using the brute-force
algorithm; tests loop optimization.

mole -- A molecular dynamics simulation, with performance predicated on
matrix operations, loop efficiency, and sin() and cos(). I recently
added this test, which exhibits very different characteristics from alma
(even if they appear similar).

tree -- Creates and modifies a large B-tree in memory; tests integer
looping, and dynamic memory management.

That's all for now, folks.

..Scott

-- 
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing



More information about the Gcc mailing list