I have developed a code under c++ for some engineering calculations in fluid mechanics. I transfered the code in Fortran 77 and benchmark the speed of 2 executables. The unexpected result: Fortan exe goes up to 4 times faster that c++!!! It was a big surprice for me, but i take a look in the web and i found some guys states that Fortan speeds better than c++.
The c++ (console application) compiled under Microsoft and Borland compilers (the results is almost the same) with all speed optimazations available from each one compiler. Program runs under Pentium 4. Also i must say that program uses about 30 MB of memory for arrays (dynamic allocated). All calculations are performed with double precision. c++ programm is using a class where all the action takes place. I tyied and c style, without a class usage, but the result is the same.
Can any one explain me what's going one?