|
From: Michael G. <mg...@te...> - 2006-03-16 14:59:59
|
> Malloc is not the problem. Right -- I added another time() and it shows that the malloc calls do usually add 0 sec and occasionally 1 sec. > I wouldn't know enough about the assembled code to know what was going=20 > on and decipher it. I would have thought though that gcc would create=20 > similar code. I have tried your code and the gcc invocations on Linux with both 3.3.5 as well as 4.0.2. 3.3.5 mostly reflects your results (about 23 sec on my machine). However the -ffast-math version with 4.0.2 results in about 9 sec on my machine which is pretty similar to your 8.9 sec using .NET I have not bothered to check on the generated assembly however all but the -ffast-math version requires -lm on Linux which probably implies there is a subroutine call involved. Therefor I guess Greg Chicares assumption that the difference in speed is due to FSIN inline (or something similar) as opposed to actually calling a subroutine has some probability. However according to the gcc docs -ffast-math option impacts reproduceability of the results on different platforms etc. Best, Michael =2D-=20 Vote against SPAM - see http://www.politik-digital.de/spam/ Michael Gerdau email: mg...@te... GPG-keys available on request or at public keyserver |