Originally posted by Serge K:
With #pragma warning(disable: 4035) you should not have any warnings about these functions.
OK, my mistake. It generated a warning, not an error, so it can compile (maybe I had another error in my code that I confused with it, or maybe I was just being dumb).
OK, quick test using VC++ compiling with full optimizations. Called fabs in a loop 1,000,000,000 times. As it turns out, the library version of fabs is about 5 times faster than Humus’ version of fabs. However, using the debug build, Humus’ version is about 40% faster than the VC++ library version of fabs, so thats probably why he thought it was faster.
Guess this just helps to reinforce the idea that you should NEVER try to optimize your code based on the timings taken in the debug build. I remember one time long ago when I spent about 2 hours optimizing some code. It seemed that my optimizations had made the code about 3 times faster. Then when I switched to release build, my optimized release build was the exact same speed as the unoptimized release build. You can bet I havent made that mistake since then.
Somehow, this discussion got way off topic