GCC vs Sun CC on SPARC

Eric Botcazou ebotcazou@libertysurf.fr
Thu Feb 5 20:46:00 GMT 2004


Hi,

I recently ran into this article, which benchmarks GCC 2.95.3 vs GCC 3.3.2 vs 
Sun ONE Studio 7 CC on an old UltraSPARC 5 machine:

   http://www.osnews.com/story.php?news_id=5830

Summary: in 32-bit mode, GCC 3.3.2 code runs slightly slower than GCC 2.95.3 
code and slower than Sun CC code (time delta: ~15%).  In 64-bit mode, there 
is again a ~15% gap between GCC 3.3.2 and Sun CC.


As I have access to a more modern SPARC technology, I decided to do the gzip 
benchmark with GCC 2.95.3 vs GCC 3.3.2 vs GCC 3.4pre vs Sun ONE Studio 8 CC 
on a Sun Fire V250.  The complete results are attached.

Summary:
- the Sun compiler produces very large (stripped) binaries with -fast, whose 
size is only matched by GCC with -funroll-all-loops (this latter option 
doesn't help wrt to -O2 and -O3, except for GCC 3.3.2).
- in 32-bit mode, GCC 2.95.3 code runs slower than Sun CC code (time delta: 
13.5%), while GCC 3.3.2 code is on par with GCC 2.95.3 code (but only with  
-funroll-all-loops).  GCC 3.4pre code is always faster than the 3 others 
(time delta: -2.5% against Sun CC).
- in 64-bit mode, GCC 3.3.2 code runs slower than Sun CC code (time delta: 
20%) and GCC 3.4pre code runs slower than Sun CC code too, although by 
roughly half the previous margin (time delta: 11%).


The results for GCC 3.4pre are pretty encouraging (amazing ?), especially in 
32-bit mode, but even in 64-bit mode given the larger initial gap.  I'm 
going to try to figure out where the difference comes from.  Any ideas?

-- 
Eric Botcazou
-------------- next part --------------
32-bit GCC vs Sun ONE Studio 8 CC:

cc: "-fast -xarch=v8plusa -xchip=ultra"
gcc: "-mcpu=ultrasparc" + others


-rwxrwxr-x   1 eric     eric       61564 Feb  5 04:08 gzip-O2-295
-rwxrwxr-x   1 eric     eric       61880 Feb  5 04:11 gzip-O2-332
-rwxrwxr-x   1 eric     eric       61684 Feb  5 04:42 gzip-O2-34

-rwxrwxr-x   1 eric     eric       62652 Feb  5 04:09 gzip-O3-295
-rwxrwxr-x   1 eric     eric       65424 Feb  5 04:12 gzip-O3-332
-rwxrwxr-x   1 eric     eric       68572 Feb  5 04:40 gzip-O3-34

-rwxrwxr-x   3 eric     eric       92028 Feb  5 04:46 gzip-O3-fual-295
-rwxrwxr-x   1 eric     eric       97272 Feb  5 04:35 gzip-O3-fual-332
-rwxrwxr-x   1 eric     eric       97628 Feb  5 04:35 gzip-O3-fual-34

-rwxrwxr-x   3 eric     eric      101216 Feb  5 07:14 gzip-cc


20 MB:

./gzip-O2-295      config.tar  3.41s user 0.04s system 100% cpu 3.445 total
./gzip-O3-295      config.tar  3.40s user 0.03s system 99% cpu 3.446 total
./gzip-O3-fual-295 config.tar  3.43s user 0.02s system 99% cpu 3.459 total

./gzip-O2-332      config.tar  3.56s user 0.02s system 100% cpu 3.561 total
./gzip-O3-332      config.tar  3.55s user 0.03s system 99% cpu 3.580 total
./gzip-O3-fual-332 config.tar  3.39s user 0.06s system 99% cpu 3.474 total

./gzip-O2-34       config.tar  2.92s user 0.07s system 99% cpu 2.999 total
./gzip-O3-34       config.tar  2.98s user 0.03s system 99% cpu 3.018 total
./gzip-O3-fual-34  config.tar  2.93s user 0.04s system 99% cpu 2.971 total

./gzip-cc          config.tar  3.00s user 0.02s system 99% cpu 3.022 total



133 MB:

./gzip-O2-295        gcc.tar  22.95s user 0.57s system 98% cpu 23.767 total
./gzip-O3-295        gcc.tar  22.87s user 0.57s system 98% cpu 23.707 total
./gzip-O3-fual-295   gcc.tar  22.98s user 0.51s system 98% cpu 23.732 total

./gzip-O2-332        gcc.tar  23.79s user 0.48s system 98% cpu 24.522 total
./gzip-O3-332        gcc.tar  23.80s user 0.50s system 99% cpu 24.523 total
./gzip-O3-fual-332   gcc.tar  23.07s user 0.50s system 98% cpu 23.851 total

./gzip-O2-34         gcc.tar  19.92s user 0.60s system 99% cpu 20.687 total
./gzip-O3-34         gcc.tar  20.16s user 0.43s system 99% cpu 20.787 total
./gzip-O3-fual-34    gcc.tar  19.96s user 0.47s system 98% cpu 20.693 total

./gzip-cc            gcc.tar  20.22s user 0.53s system 99% cpu 20.917 total




64-bit GCC vs Sun ONE Studio 8 CC:

cc: "-fast -xarch=v9a -xchip=ultra"
gcc: "-m64 -mcpu=ultrasparc" + others


-rwxrwxr-x   1 eric     eric       95888 Feb  5 07:41 gzip64-O2-332
-rwxrwxr-x   1 eric     eric       96296 Feb  5 07:44 gzip64-O2-34

-rwxrwxr-x   1 eric     eric      102800 Feb  5 07:41 gzip64-O3-332
-rwxrwxr-x   1 eric     eric      108072 Feb  5 07:45 gzip64-O3-34

-rwxrwxr-x   1 eric     eric      128400 Feb  5 07:43 gzip64-O3-fual-332
-rwxrwxr-x   3 eric     eric      131112 Feb  5 07:48 gzip64-O3-fual-34

-rwxrwxr-x   1 eric     eric      129304 Feb  5 07:33 gzip64-cc


20 MB:

./gzip64-O2-332      config.tar  4.03s user 0.11s system 100% cpu 4.111 total
./gzip64-O3-332      config.tar  4.03s user 0.05s system 99% cpu 4.089 total
./gzip64-O3-fual-332 config.tar  3.95s user 0.02s system 99% cpu 3.987 total

./gzip64-O2-34       config.tar  3.67s user 0.03s system 100% cpu 3.686 total
./gzip64-O3-34       config.tar  3.68s user 0.07s system 99% cpu 3.763 total
./gzip64-O3-fual-34  config.tar  3.67s user 0.03s system 99% cpu 3.701 total

./gzip64-cc          config.tar  3.26s user 0.08s system 99% cpu 3.344 total


133 MB:

./gzip64-O2-332       gcc.tar  27.18s user 0.55s system 99% cpu 28.003 total
./gzip64-O3-332       gcc.tar  27.19s user 0.54s system 99% cpu 27.958 total
./gzip64-O3-fual-332  gcc.tar  26.55s user 0.44s system 99% cpu 27.230 total

./gzip64-O2-34        gcc.tar  24.53s user 0.63s system 98% cpu 25.421 total
./gzip64-O3-34        gcc.tar  24.97s user 0.47s system 99% cpu 25.667 total
./gzip64-O3-fual-34   gcc.tar  24.65s user 0.59s system 98% cpu 25.519 total

./gzip64-cc           gcc.tar  22.28s user 0.49s system 99% cpu 22.974 total



More information about the Gcc mailing list