UNIX vs. VMS - SYSTEM FUNCTIONS

Chris Torek chris at mimsy.UUCP
Tue Oct 25 08:48:41 AEST 1988


In article <82 at h.cs.wvu.wvnet.edu> dymm at b.cs.wvu.wvnet.edu (David Dymm) asks
why strcpy and strlen on a Sun-3/280 are so much faster than the same
functions on a Vax running VMS 4.7, and why his own simple versions of
strcpy and strlen are faster than the ones in the C Runtime Library.

A Sun 3/280 is faster than a uVAX II in general; but in particular,
VMS is cleverly using the `locc' instruction to find the length of
the string.  This is quite a bit faster than simply looking at each
character for a '\0', since the locc instruction is in microcode ...
except on the MicroVAX, where locc must be emulated by the kernel!

4.3BSD suffers from the same cleverness.

(The Cvax chip, used in the 3000 and 6000 series machines, does
locc in microcode again.)

Chris
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list