Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site noao.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!astrovax!noao!allan
From: allan@noao.UUCP
Newsgroups: net.physics
Subject: VMS vs. Unix (timings)
Message-ID: <359@noao.UUCP>
Date: Fri, 22-Jun-84 14:09:54 EDT
Article-I.D.: noao.359
Posted: Fri Jun 22 14:09:54 1984
Date-Received: Sat, 23-Jun-84 04:15:00 EDT
Organization: Natl. Optical Astronomy Obs.  Tucson AZ USA
Lines: 71

Prompted by all the discussion on fortran vs. C and VMS vs. unix, I have run
some comparison programs and timed the results. I have run a 100 x 100 matrix
multiplication program in fortran (single precision and double precision)
and C on VMS, 4.1 and 4.2 unix. The cpu run times in seconds are shown below.
I will post the program listings separately for those who wish to pull them 
apart.


                fortran(sp)   fortran(dp)      C
vax1 no opt          69          112          102
vax1    opt          52           98           99

vax2 no opt          40           51           63
vax2    opt          40           49           64

vax3 no opt          32           43           48
vax3    opt          22           35           31


Key:
vax1 = 4.2BSD Unix#8
vax2 = Berkeley VAX/UNIX 4.1 + floating point accelerator
vax3 = VMS 3.6 + floating point accelerator

opt = optimization turned on


As far as VMS vs. unix is concerned, VMS is faster than 4.1 unix by a factor
of 1.5 on average. 4.2 unix is slower than 4.1 simply because that machine
does not have a floating point accelerator. Comparing the languages, single
precision fortran is faster than C by a factor of 1.6 on average, and there
is barely any difference between double precision fortran and C on the average.

The single comparison that is usually made is fortran on VMS vs. C on unix.
In this case fortran is faster by a factor of 3 using 4.1 unix.

You can argue anyway that you like from these numbers. Single precision fortran
is obviously fastest, but it is fairer to compare double precision fortran and
C since C does all floating point operations in double precision, but fortran
will let you use single precision when you want to where as C will not,
but,
    but,
        but,
            ..........
                       .......
                              ....
                                  ..
                                    .
                                    .                                     
                                    .

I am not prepared to defend fortran on the grounds of the 'niceness' of 
the language. For some applications, fortran stinks.
However, one thing does seem clear.

IF    the bottom line is speed of execution
THEN  you should use fortran on VMS

All the above has been concerned with vaxes. If you really need the greatest
speed, then you must go out and buy a Cray or a CDC205.
If you want to pull all of this apart by arguing that you should not generalize
from a single experiment then I suggest that you run some experiments of your
own.



Peter Allan
Kitt Peak National Observatory
Tucson, Az
UUCP:	{akgua,allegra,arizona,decvax,hao,ihnp4,lbl-csam,seismo}!noao!allan
ARPA:	noao!allan@lbl-csam.arpa