Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fortran vs C++

1 view
Skip to first unread message

JaSeong Ju

unread,
Mar 27, 2004, 9:44:46 AM3/27/04
to
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?

John Carson

unread,
Mar 27, 2004, 10:07:07 AM3/27/04
to
"JaSeong Ju" <j_kk...@yahoo.com> wrote in message
news:4065935E...@yahoo.com

I think Fortran is, or at least has been, generally considered faster for
numerical work. There has recently been an effort to match its speed in C++.
See the following background discussion for the Blitz library:

http://www.oonumerics.org/blitz/whatis.html


--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

Leor Zolman

unread,
Mar 27, 2004, 11:10:01 AM3/27/04
to

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

0 new messages