This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ptr vs ref performance?? (test case)


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]