This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: Strange optimization results


2011/4/10 Jonathan Wakely <jwakely.gcc@gmail.com>:

> Did you run the tests more than once and average the results? Your
> test code has no timing measurements in it, what are you measuring?
> The entire time for the executable to run? ?That includes time for the
> OS to create and run a new process, and will depend how busy the
> system is, so could have very little to do with the code in the
> executable.
>

I would also add, having made many similar benchmarks with gcc, that
this test is probably too trivial for meaningful results.  I wouldn't
be surprised at all if with any level of optimization, the compiler
can determine that the loop doesn't actually even have to be run more
than once, since the result is the same every time through.

  Brian


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