Tiger performance with gcc-4.0?

Viro

Registered
I've been bored today and since I've just finished compiling gcc-4.0 on Panther, I thought that I'd run a few simple benchmarks to see how much faster code runs with this new compiler.

NOTE: If you don't like speculation, just disregard this post :).

The first benchmark I ran is Scimark. It's a popular benchmark that does some typical scientific routines like FFTs and monte carlo algorithm. In the benchmark, a higher score is better. It stands for MFLOPS (Millions of Floating Point Operations per Second).

Scimark compiled with GCC 3.3 build 1671(latest publicly available GCC from Apple said:
Using 2.00 seconds min time per kenel.
Composite Score: 229.51
FFT Mflops: 195.54 (N=1024)
SOR Mflops: 283.38 (100 x 100)
MonteCarlo: Mflops: 37.39
Sparse matmult Mflops: 271.93 (N=1000, nz=5000)
LU Mflops: 359.30 (M=100, N=100)

Scimark compiled with GCC 4.0 built from source said:
Using 2.00 seconds min time per kenel.
Composite Score: 263.43
FFT Mflops: 203.77 (N=1024)
SOR Mflops: 439.94 (100 x 100)
MonteCarlo: Mflops: 26.42
Sparse matmult Mflops: 271.93 (N=1000, nz=5000)
LU Mflops: 375.09 (M=100, N=100)

As you can see, just changing the compiler but keeping the code the same, GCC 4.0 produced an executable that is 15% faster overall. Only thing that performed worse was the Monte Carlo simulation, and I'm guessing it's because GCC 4.0 doesn't do well with optimizing recursion. Further investigation is necessary to know for certain.

With my own code which is a run of the NDS neuron (a model I'm working on), the results are follows (results in execution time so lower is better):
3 NDS Neuron network said:
GCC-3.3 = 19 seconds
GCC-4.0 = 17 seconds

We get about 15% performance improvement too! So assuming this holds for most other code and especially for Tiger, we might see some performance improvements even if they do not do anything but just recompile the code with the new compiler. Which is quite awesome.
 
I haven't tried anything computationally intensive with GCC4 but I just tried compiling some code to see if it would compile without any changes and it worked as normal.

Are your results with the auto vectorization turned on?
 
Nope, I didn't turn on autovectorization. I've got no idea how to enable it...

EDIT: Browsing the documentation for the developmental branch of GCC, I've added -ftree-vectorize and it doesn't seem to speed anything up. The composite score went up 7 points, to 270. Quite a let down actually as I was expecting some sort of major boost, especially on this benchmarks, as FFTs can be quite easily vectorized.
 
I think you would pass in --GCC_AUTO_VECTORIZATION=TRUE or something to the compiler. I hardly every compile stuff with the command line so that might be wrong.
 
Glad to hear some on this front.
I remember some time ago on one of those gcc threads that version 3.5 (now renamed to 4.0) would speed some things up due to better/more effective compiling and due to some auto_vectorization.
I haven't compiled something in gcc 4.0 so far.
But my question is:
Does the speedup only affect heavy cpu intensive applications or can we also espect to see some gains in overal computer using. More like, starting up applications, window resizing etc. ?
related: Does every app benefits speed from this recompile in gcc 4.0 ?

GreetZ ;-)
 
Well, the speedup should be general. Reason being that none of the apps that I've tried could be auto vectorized. Even so, you still get the 15% speed improvement. Granted, this would differ from application to application, but I think it should give some speed increase at the very least. Whether it's measurable or noticeable, that's another thing :).

Shouldn't affect application startup. That's got nothing to do with runtime performance and it's largely outside the realm of the compiler to optimize startup times (unless the compiler was broken to begin with and gave apps that took ridiculous amounts of time to start).

But it's all conjecture at this point and we'll really have to wait and see when Tiger is released. I started this post hoping that ppl who have Tiger can confirm these increases in speed of compiled apps over 10.3. Guess not many people are developers, or more likely Apple has some NDA forbidding discussion on Tiger's performance.
 
Well, it is more along the lines of nearly impossible to quantify just yet. Most software is written and compiled using 3.3 currently, so it will continue to run as it has under Tiger. Tiger itself and its speedups aren't always gonna affect the apps directly, not to mention that there was a lot of work being done to re-write parts of the graphics engine which has created glitches and other nasties on certain machines that needed to get sorted out first.
 
I mis-read one of the posts that seemed to ask if current apps will run faster on Tiger because of the GCC 4.0 stuff if it wasn't recompiled. My bad.
 
Back
Top