Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 1996 16:27:25 -0800
From:      John Polstra <jdp@polstra.com>
To:        Andreas Klemm <andreas@knobel.gun.de>
Cc:        freebsd-current@freebsd.org
Subject:   Re: dhrystone 2.1 result for gcc-2.7.2 with Pentium patches is poor 
Message-ID:  <199601240027.QAA03484@austin.polstra.com>
In-Reply-To: Your message of "Tue, 23 Jan 1996 21:54:10 %2B0100." <199601232054.VAA02000@knobel.gun.de> 

next in thread | previous in thread | raw e-mail | index | archive | help
Andreas Klemm wrote:

> > I haven't tried those patches, but this kind of thing comes up regularly
> > in compiler-related newsgroups.  Look: the Dhrystone "benchmark" is
> > _completely_ worthless and meaningless for today's compilers.  You are
> > wasting your time messing with it.  It will only mislead you.
> 
> Ok, but then please tell me another easy way how I can proofe the
> quality of the resulting code...

The SPEC benchmarks seem to be what everybody uses, but, unfortunately,
they cost money.  I'd recommend that you look at the comp.benchmarks FAQ.
The latest version is at:

    ftp://rtfm.mit.edu/pub/usenet-by-group/comp.benchmarks/

in the file "comp.benchmarks_Frequently_Asked_Questions,_With_Answers".
(No kidding!)  An older version is on the Web at:

    http://hpwww.epfl.ch/bench/bench.FAQ.html

> I simply thought, that _if_ there are patches for gcc, that add support
> for a Pentium processor, then nearly every kind of executable should 
> speed up because gcc now uses the whole power of ... hmmm let's say
> instruction set.
> 
> I really didn't expect slower results. Please explain to me why
> you think, that those Pertium patches are possibly really ok
> if the dhrystone result is relatively poor.

I really don't know whether the Pentium patches are any good or not -- I
have no idea.  I was only trying to make the point that Dhrystone is not
a good benchmark to use for modern compilers.  It was always supposed
to be a hardware benchmark anyway, not a compiler benchmark.  The
instructions that came with it used to forbid you from turning on
optimization when compiling it!

Dhrystone is dominated by string operations, especially strcpy with a
constant source string, like this:

    strcpy(buf, "Man soll das Fell des Bären nicht verteilen,"
	" bevor man ihn erlegt hat.");

Dhrystone-aware compiler writers long ago added optimizations that turn
this construct into an open-coded string of 4-byte store immediate
instructions.  (I've done it myself a few times.)  Doing so makes the
Dhrystone run blindingly fast, but it doesn't make a significant
difference for any real-world application.

Maybe this kind of optimization confuses the changes introduced by the
Pentium patches -- who knows?  My point was just that the numbers you
get from Dhrystone aren't a reliable basis for drawing any conclusions
about your compiler.

Besides, if I remember correctly, the two numbers you quoted were,
relatively speaking, _very_ close together.  The difference between them
is probably not significant.

-- John



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601240027.QAA03484>