Re: Fortran vs. C++ : Which is best to choose now i

From: glen herrmannsfeldt (gah_at_ugcs.caltech.edu)
Date: 02/08/04


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



Relevant Pages

  • Re: Fortran vs. C++ : Which is best to choose now i
    ... > typically ran up to 7 times slower than the original. ... In days past when machines were smaller and slower, ... Not that one shouldn't take advantage of faster machines with ...
    (comp.lang.fortran)
  • Re: Great SWT Program
    ... which is where the configuration files ... are shared by all machines. ... won't be apparent. ...
    (comp.lang.java.programmer)
  • Re: "Many" happy selinux users nowadays
    ... I value it for what it can do at the moment of the attempted compromise. ... or not install software as THEY see fit. ... I have no desire to influence what other people put on their machines. ...
    (Fedora)
  • Re: Without rebooting-Now changing ISP
    ... different machines, my suspicion is that I need to install the server ... different users here would then access the local server and download ...
    (comp.sys.acorn.networking)
  • Re: My Continuing Adventures With Linux
    ... of the newer SW you need high spec boxes and I'm just not going to go out and spend $1K or more getting more/new boxes and HW just so I can use the latest SW when all of my old boxes work fine, and I can do wp & spreadsheets & internet jazz to my heart's content. ... Considering that many versions of Linux aren't commercial, and that there are a number of volunteers working on it, the chances of serious bugs arising is likely reduced as there are no deadlines to meet and no advertising propaganda to live up to. ... One department at my alma mater had a few machines running it but I never spent much time on them. ...
    (sci.research.careers)