PDA

View Full Version : [LF] Fortran 90 vs C++ Valarrays


Lahey Support
08-15-2003, 01:19 AM
Hi all,

In a recent article "Comparing Fortran 90 and C++ Valarrays" in C/C++ Users
Journal, the authors (Shyam Bhat and B. Arun) compared MSVC++ 5.0 and
Microsoft PowerStation v 4.0 with their finite element method program on
a Pentium 150MHz with 48MB. Here is their result:

Test # of eqn matrix size F90 C++
---- -------- ----------- ----- -----
1 4353 520,000 3,244 3,095
2 3492 320,000 1,612 1,532
3 2088 180,000 921 871
4 987 65,000 265 250

The "matrix size" is in # of doubles and the timing values are in msec.
The authors' conclusion is that C++ has a speed advantage of 5%.

Note that valarrays is a C++ STL implementation.

Does anyone out there have similar results? C++ is a complex language and
STL in general in not very efficient. It is strange that C++ with valarrays
can beat Fortran. There are certainly a lot of unknown factors such as
the quality of PowerStation v 4.0 and the testing program, the switches used
for the compilation and others. If LF90/LF95 cannot maintain a speed lead,
many engineers/scientists will jump to C++ quickly. I am afraid that this
is happening in many places, including this university.

CKS