Edit: See my reply below this post.
-------------------------------------------------
Well the results I got were nothing short of shocking. VB.NET beat C VS8.0 by a large margin. What I did was x=cos(sin(tan(i))), increasing i from 0 to 4194303 (4194304 times). I was about to say you could amputate my foot should .NET ever be faster than C. It looks like I just lost my foot.
C (VS6.0) with math.h library: Operation completed in 891 ticks (5430734-5431625).
C (VS8.0) with math.h library: Operation completed in 1579 ticks (3954046-3955625).
VB.NET 2005 Express: Operation completed in 875 ticks (4422468-4423343).
Maybe VB.NET is faster than assembler. :evil: This is work of the devil.
It could be VS2005 C++ Express's C compiler blows chunks, so I'll do it with VS6 also.
Perhaps someone can point out a major flaw in my code, but if there is, I couldn't begin to think what it would be.
Code attached.
Edit: added VS6 results. They seem a little closer now. .NET is still faster by a hair, which is frankly amazing. I thought VC8.0 was supposed to be the most optimized C compiler?
-------------------------------------------------
Well the results I got were nothing short of shocking. VB.NET beat C VS8.0 by a large margin. What I did was x=cos(sin(tan(i))), increasing i from 0 to 4194303 (4194304 times). I was about to say you could amputate my foot should .NET ever be faster than C. It looks like I just lost my foot.
C (VS6.0) with math.h library: Operation completed in 891 ticks (5430734-5431625).
C (VS8.0) with math.h library: Operation completed in 1579 ticks (3954046-3955625).
VB.NET 2005 Express: Operation completed in 875 ticks (4422468-4423343).
Maybe VB.NET is faster than assembler. :evil: This is work of the devil.
It could be VS2005 C++ Express's C compiler blows chunks, so I'll do it with VS6 also.
Perhaps someone can point out a major flaw in my code, but if there is, I couldn't begin to think what it would be.
Code attached.
Edit: added VS6 results. They seem a little closer now. .NET is still faster by a hair, which is frankly amazing. I thought VC8.0 was supposed to be the most optimized C compiler?