Xref: utzoo comp.lang.fortran:4122 comp.lang.c:34199 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!hsdndev!husc6!m2c!jjmhome!smds!rh From: rh@smds.UUCP (Richard Harter) Newsgroups: comp.lang.fortran,comp.lang.c Subject: Re: Fortran vs. C for numerical work Summary: Good compilers beat bad compilers Message-ID: <258@smds.UUCP> Date: 24 Nov 90 06:57:35 GMT References: <21884@orstcs.CS.ORST.EDU> Followup-To: comp.lang.fortran Organization: SMDS Inc., Concord, MA Lines: 23 In article <21884@orstcs.CS.ORST.EDU>, ghe@comphy.physics.orst.edu (Guangliang He) writes: > In article bglenden@mandrill.cv.nrao.edu (Brian Glendenning) writes: > It may not be true any more. A friend of mine brought a little fortran > program (It is two big do loops with some instrinsic function calculation in > the loop.) and the C translation of the fortran program. We compiled two > program on a IBM RISC System 6000/530 with xlc and xlf. To my surprise, the > excutable from C is faster than the excutable from Fortran by a few percent. This probably has nothing to do with the merits of C versus Fortran and has everything to do with the merits of the compilers involved. In the UNIX world C compilers are often optimized to a gnats posterior whereas Fortran compilers are often relatively primitive. The converse is true in environments where Fortran is big and C is just another minor language. Fundamentally Fortran compilers can be faster because the Fortran language specification forbids aliasing (but makes the user responsible for making sure that it is not present) whereas C has to deal with it. -- Richard Harter, Software Maintenance and Development Systems, Inc. Net address: jjmhome!smds!rh Phone: 508-369-7398 US Mail: SMDS Inc., PO Box 555, Concord MA 01742 This sentence no verb. This sentence short. This signature done.