UNIX vs. VMS - SYSTEM FUNCTIONS

Paul De Bra debra at alice.UUCP
Tue Oct 25 12:50:41 AEST 1988


In article <82 at h.cs.wvu.wvnet.edu> dymm at b.cs.wvu.wvnet.edu (David Dymm) writes:
-
-*** Question 1 ***
-I have been timing the relative differences between the speeds
-of the functions "strlen" and "strcpy" as executed on UNIX
-and VMS.  Why is one system so much faster?  Is it just the machine
-mips that accounts for the differences?
-
-*** Question 2 ***
-I am also concerned on VMS with the differences between the use of the
-"system" functions and my own function.
-
-
-VMS - We are running vms 4.7 with version 2.3 of the C compiler
-on a Vaxstation 2000. 
-UNIX - We are running Sun 3.5 (UNIX BSD 4.2) on a 3/280 set up
-as a multi-user system with 14 users connected via a multiplexor.
-
-For example, the following times (seconds) for strlen computes the length
-of an 80 charactrer string in a loop 200,000 times:
-	UNIX		VMS
-		    system    mine
-	10	      68       51
-
I ran a similar program on my Microvax II with the ninth edition Unix.
Result 66.5 sec.

-The following times (seconds) for strcpy does 200,000 string copies
-with the copied string 50 characters in length:
-	UNIX		VMS
-		    system    mine
-	6.5	       57      29
-
The Microvax II did this in 51.5 seconds.

So VMS is not doing a really lousy job. The Microvax II (or VaxStation 2000)
is not nearly as fast as a Sun 3/280.

But the difference is more than I can explain from the raw cpu-speed. I did
some more benchmarking with Suns and Vaxen and the difference should not
exceed a factor of 4 or 5. So Sun must have done some optimization to the
routines, or generate efficient code for string operations.
Your code for strcpy already indicates that one can generate faster routines
than the standard libraries.
In fact, in BSD 4.3 a number of libraries have been rewritten to make them
more efficient.

Paul.

-- 
-------------------------------------------------------------------------
|debra at research.att.com   | uunet!research!debra     | att!grumpy!debra |
-------------------------------------------------------------------------



More information about the Comp.unix.questions mailing list