Fortran vs. C for numerical work

William Rosencranz rosenkra at convex.com
Thu Nov 22 19:40:33 AEST 1990


In article <21884 at orstcs.CS.ORST.EDU> ghe at comphy.PHYSICS.ORST.EDU.UUCP (Guangliang He) 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 says nothing about the *language*, only the *compilers*. actually, it
may not be that suprising when u consider that the 6000 runs unix and unix
needs a good C compiler. IBM may have spent more time on the C compiler than
the fortran compiler, figuring that more people may use C on the box than
fortran. believe it or not, i have seen similar behavior on crays (cft77 vs
scc [actually vc at the time], though also by only a few percent).

this does say that this particluar code seems well suited for C on the 6000
today. it implies that C is not a bad language for numerical work, if
performance is the criterion.

-bill
rosenkra at convex.com
--
Bill Rosenkranz            |UUCP: {uunet,texsun}!convex!c1yankee!rosenkra
Convex Computer Corp.      |ARPA: rosenkra%c1yankee at convex.com



More information about the Comp.lang.c mailing list