|
this is not surprise. Math.pow uses a generic algorithm that works for any exponent, including non-integers etc.
Posted by michal, on Wednesday, 07 February 2007 at 3:17
You're right :). But in my case ( f8 and Windows, too ) it is about 65-67 % faster. How about that?
Posted by sema, Whose homepage is http://szemraj.eu on Wednesday, 07 February 2007 at 3:19
Some C/C++ compilers do all kinds of optimization for you. I was kinda hoping Flash would do that too. But I guess not.
Posted by Johan van Mol, on Wednesday, 07 February 2007 at 4:37
For Math.pow() to support variable powers, it has to use logarithmic functions, which are way slower than multiplication functions.
Posted by Randy Edmunds, on Wednesday, 07 February 2007 at 11:28
You mean 22% right.
if x*x takes 366msec and Math.pow takes 477msec. then x*x must be 22% faster than Math.pow
x*x use only 78% of the time that Math.pow uses
Posted by Klaus, on Friday, 28 September 2007 at 3:42
|