On Sat, 27 Mar 2004 23:44:46 +0900, JaSeong Ju <j_kka
...@yahoo.com> wrote:
>This is a little off topic but I still think this is the best place to ask.
>I have met some people who use exclusively fortran (77,90,95)
>to do their programming and scientific simulation work.
>They claim that fortran is much faster than C++.
>They also go on to cite advantages of fortran over C++.
>It is annoying to hear such claims (even derogatory comments)
>about C++ by people who have never used C++ before.
>Im wondering just how does fortran and C++ performance compares?
>Is the performance disparity a myth? or is it real?
>It seems that fortran folks program C++ in fortran style, hence
>making the code inneficient, and blaming the language for being slow.
>And telling their friends not to use C++.
>Anyone with an objective opinion?
Sure, Bjarne Stroustrup ;-)
At SD West, Bjarne began a section of his first talk by pointing out how
everybody "knows" that Fortran is the fastest platform for numeric
applications... and then put up a slide showing curves for performance of
dense matrix-vector multiplications on several platforms. The results were
that a good optimizing C++ compiler outperformed Fortran by between 40% and
around 15% (the difference diminishing with the size of the operands,
presumably due to the correspondingly diminishing benefits of cache
locality).
Bjarne's point was that, dealing a language permitting higher-level
abstractions than Fortran does, the C++ compilers had more information to
go on with which to optimize the generated code (and as a result, were able
to elide temporaries in cases where Fortran, by its nature, couldn't have a
clue.)
So the performance disparity is quite real -- just tipped the opposite way
than what most people thought ;-)
-leor
--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html