Re: Fortran vs. C++ : Which is best to choose now i
From: glen herrmannsfeldt (gah_at_ugcs.caltech.edu)
Date: 02/08/04
- Next message: Steve Lionel: "Re: Intel ifort compiler problem - part II"
- Previous message: E. Robert Tisdale: "Re: Fortran vs. C++ : Which is best to choose now i"
- In reply to: Gerry Thomas: "Re: Fortran vs. C++ : Which is best to choose now i"
- Next in thread: glen herrmannsfeldt: "Re: Fortran vs. C++ : Which is best to choose now i"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 08 Feb 2004 22:21:24 GMT
Gerry Thomas wrote:
(snip)
> Several years ago UK AEAT acquired a CFD and heat transfer FORTRAN code
> (TASCFLOW) which was a highly respected and successful commercial product
> developed as an offshoot of the work of Raithby at the University of
> Waterloo. As new owners, AEAT rewrote the code to benefit from the alleged
> advantages of C++ over FORTRAN. They initially satisfied themselves that
> both codes gave consistent results for the same problems but the C++ code
> typically ran up to 7 times slower than the original.
(snip)
Object oriented programming tends to encourage memory allocation and
deallocation, which are often slow. Someone new to such languages,
or trying to emphasize the object oriented aspect might easily overuse
objects.
For numeric programs that have deeply nested loops one should be
especially careful to keep object creation out of such loops.
In days past when machines were smaller and slower, techniques to
minimize wasting of machine resources were taught. As machines
got faster and larger, those techniques tend to be forgotten.
Not that one shouldn't take advantage of faster machines with
larger memories, but there is no point in wasting resources,
either. I am certainly not surprised that C++ code could
run seven times slower. With careful planning it should be
possible to do much better.
-- glen
- Next message: Steve Lionel: "Re: Intel ifort compiler problem - part II"
- Previous message: E. Robert Tisdale: "Re: Fortran vs. C++ : Which is best to choose now i"
- In reply to: Gerry Thomas: "Re: Fortran vs. C++ : Which is best to choose now i"
- Next in thread: glen herrmannsfeldt: "Re: Fortran vs. C++ : Which is best to choose now i"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|