Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!umich!samsung!sdd.hp.com!uakari.primate.wisc.edu!aplcen!uunet!interet!jim From: jim@interet.UUCP (User) Newsgroups: comp.lang.fortran Subject: Re: f2c is almost great Summary: here are benchmarks for f2c Keywords: f2c fortran benchmarks Message-ID: <4@interet.UUCP> Date: 24 Aug 90 19:25:29 GMT References: <3@interet.UUCP> Organization: Interet, Maplewood, NJ Lines: 43 Here are some benchmarks comparing the f2c compiler with two Fortran com- pilers. The benchmark program is 3,616 lines of Fortran. It is a sim- plex linear optimization engine which reads in the problem coefficients from disk, solves the problem, and writes about 30 lines of results to the terminal. This is a real-world program that we actually use. It is writ- ten in elementary Fortran, it uses only double precision floating point, no transcendental functions, and uses sparse matrix techniques. Times given are the sum of "user" and "system" time as reported by the Unix "time" command. The problem is CPU intensive, and "system" time is at most a few percent of "user" time. The program was tested on a small and a large problem. For each computer the same Fortran source was compiled using the maximum optimization level. Then the Fortran source was converted to C using f2c. Then the C source was compiled using maximum optimization. The answers agreed to the ten decimal places printed, but Fortran writes "D+02" and f2c writes "E+02". The first tests were run on a Pyramid 9810 under OS 5.0c using Pyramid Fortran 4.4.0 dated 4-28-89, and the Pyramid C compiler Ver 4.7 dated 4- 12-89. Results were: Fortran small problem: 596 iterations, 20.2 seconds, relative 1.00 f2c small problem: 592 iterations, 26.1 seconds, relative 1.29 Fortran large problem: 1860 iterations, 131.4 seconds, relative 1.00 f2c large problem: 2095 iterations, 199.6 seconds, relative 1.52 (1.35) Then the same tests were run on a Sun 3/60 under OS 4.0.3 and Fortran 1.3. Results were: Fortran small problem: 575 iterations, 44.9 seconds, relative 1.00 f2c small problem: 625 iterations, 54.5 seconds, relative 1.21 Fortran large problem: 2028 iterations, 330.5 seconds, relative 1.00 f2c large problem: 2024 iterations, 356.8 seconds, relative 1.08 Interpretation is complicated by the fact that a different number of sim- plex iterations were performed by different cases, even though the prob- lems were identical. For these benchmarks, f2c is always slower by 8% to either 52% or 35% (depending on whether total time or time per iteration is used). Jim the grizzled Fortran hacker uunet!interet!jim