Dhrystone benchmark results from GNU C compiler
phr at mit-hermes.UUCP
phr at mit-hermes.UUCP
Thu Feb 19 20:36:52 AEST 1987
I just ran the notorious Dhrystone benchmark through the GNU C
compiler and compared the results with the Unix compiler. They
generally favor GCC. Recent discussion on comp.arch suggests that
Dhrystone is not a wonderful measurement of either CPU or compiler
performance, but it's better than nothing; don't treat these numbers
as if they were holy.
The first four runs were with 50000 Dhrystone passes; the last two
were with 500000. The 500000 pass test was time consuming so I only
ran it with optimizers on (the interesting case). Each of the first
four tests were run twice in succession to get things into cache, and
the SECOND timing is given in each case. The last two tests were run
only once each. All measurements were taken on an unloaded diskless
Sun 3/75 workstation with 8 megabytes of memory running Sun 4.2bsd
Unix. I don't know the exact release numbers of the Sun OS or
compiler. Times are in seconds, sizes in bytes. Compile times are
user time followed by system time.
Compiler Compile time Code size Run time Dhrystones/sec
GCC, opt off 3.6u/1.8s 1888 18.5 2707
Sun cc, opt off 3.9u/1.4s 1812 16.4 3061
Sun cc -O 5.5u/1.8s 1576 15.0 3363
GCC -O 4.0u/1.4s 1348 12.6 4005
Sun cc -O (as above) 149.3 3368
GCC -O (as above) 125.4 4012
Remarks:
1. GCC will go into beta test pretty soon now; we'll make an
announcement when that happens. Please don't flood us with mail
yet. It will eventually be distributed free, like GNU Emacs.
(Hats off to RMS for this winning new compiler).
2. Code from GCC without -O runs slow because some optimizations
are deliberately not done in order to improve debuggability of the
object code. However, you can still use gdb or dbx on gcc -O
output, with some success.
3. Dhrystone.c is probably not large enough for the code size numbers
in this test to be meaningful, but generally gcc -O output is
several percent smaller than cc -O output.
4. I hope to try the benchmark on the Vax pretty soon.
More information about the Comp.lang.c
mailing list