Mail Archives: djgpp/1997/04/07/05:37:26
Hi,
BECman wrote:
> He is doing 50,000 calculations in a 'for' loop, not pausing.
> I'm sure this should be in the FAQ, as it's one of the
> important aspects that everyone needs.
When benchmarking:
Make sure, that the result of the calculations is used
afterwards (in a printf or so).
If you don't, a smart compiler will optimize it, and remove
the calculations entirely.
This is what happened to me, after writing a very naive
benchmark :-)
The smart compiler was Sun's cc.
Bram
>
> Graham.
--
o----------------------------------------------------------------------o
| Bram Stolk, ElectroGIG, Wibautstraat 137c, 1097DN Amsterdam, Holland |
| tel: +31 20 462 462 0 email: bram AT gig DOT nl home: stolk AT xs4all DOT nl |
| |
| "Real programmers do not comment their code -- it was hard to write, |
| it should be hard to understand." |
o----------------------------------------------------------------------o
- Raw text -