iteration over arrary

Started by
11 comments, last by nano 20 years, 9 months ago
quote:That is, 99%? In my experience that means the same. Run it again/use another compiler/use another computer and you might get 98%, or 101%. Maybe even a couple more percent difference than that. In fact, I think some compilers are capable of optimizing them into the same thing. Basically, don''t worry about such a small difference. The common wisdom is "optimize by changing the algorithm, let the compiler handle the micro-optimizations".


As I said earlier, I was just curious. I know it''s useles
to be thinking of such tiny details when the compilers
will probably always do better that me.
It''s still always interesting to know.
Advertisement
quote:Original post by nano As I said earlier, I was just curious. I know it''s useles
to be thinking of such tiny details when the compilers
will probably always do better that me.
It''s still always interesting to know.

What''s even more interesting, and educational, is to see what assembly code the two programs produce. Check it out.... you may learn something interesting about the i386 instruction set, and about optimizing compilers.

How appropriate. You fight like a cow.
quote:Original post by nano
If this is all you wanted to say then why the h**l did you post?

I was hinting that the calculation you specified would be applied at compile-time. Does that help untwist your knickers?

This topic is closed to new replies.

Advertisement