Original Post
Hi,
Lately I found quite interesting thing. Everybody writes that standard mathematical functions in math library in c++ are very slow, and therefore are inadequate for game programming. I have made few tests using so called "fast" functions and standard ones in VC++ 2010 express ed. Everything written in many articles was true (that fast functions are faster than standard ones) until I changed into release mode instead debug mode. Than it turned out that standard math functions were 4 to 6 times faster than those "fast" ones. Tested functions were sin(x) and sqrt(), and 1.0f/sqrt(x).
Am I doing something wrong?
Performance has been tested by measuring time of for example 10^6 calls of function.
Regards,
Misery
PS: of course I have used 'inline' and so on.
Lately I found quite interesting thing. Everybody writes that standard mathematical functions in math library in c++ are very slow, and therefore are inadequate for game programming. I have made few tests using so called "fast" functions and standard ones in VC++ 2010 express ed. Everything written in many articles was true (that fast functions are faster than standard ones) until I changed into release mode instead debug mode. Than it turned out that standard math functions were 4 to 6 times faster than those "fast" ones. Tested functions were sin(x) and sqrt(), and 1.0f/sqrt(x).
Am I doing something wrong?
Performance has been tested by measuring time of for example 10^6 calls of function.
Regards,
Misery
PS: of course I have used 'inline' and so on.