This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ptr vs ref performance?? (test case)
- To: rob at e-critical dot com (Rob Willis)
- Subject: Re: ptr vs ref performance?? (test case)
- From: Tim Hollebeek <tim at hollebeek dot com>
- Date: Thu, 14 Dec 2000 21:31:55 -0500 (EST)
- Cc: tim at hollebeek dot com (Tim Hollebeek), gcc at gcc dot gnu dot org (gcc at gcc dot gnu dot org), mrs at windriver dot com
Rob Willis writes ...
>
> Also, for these kind of performance tests - i compile with NO
> optimizations turned on.
Well, that's your problem right there. Why do you expect the compiler
to generate the fastest compiled code if you don't *ASK* it to generate the
fastest code it can?
By turning no optimizations on, you indicate to the compiler that
speed is not a priority. If the compiler gives you slow, but
accurate, simple, and easy to debug code that's what you asked for.
Why are you suprised?
If two equivalent pieces of code give the same results modulo speed
differences, why are you suprised? You didn't ask for the fastest
possible code. Heck, you didn't even ask for *fast* code.
Forget "Garbage in, garbage out".
"Requirements not communicated, requirements not satisfied." Running
benchmarks on unoptimized code simply demonstrates a very poor
understanding of benchmarks.