Xref: utzoo comp.os.vms:9602 comp.unix.questions:9908 comp.unix.wizards:11927 Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!husc6!purdue!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.os.vms,comp.unix.questions,comp.unix.wizards Subject: Re: UNIX vs. VMS - SYSTEM FUNCTIONS Message-ID: <14145@mimsy.UUCP> Date: 24 Oct 88 22:48:41 GMT Article-I.D.: mimsy.14145 References: <82@h.cs.wvu.wvnet.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 20 In article <82@h.cs.wvu.wvnet.edu> dymm@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@mimsy.umd.edu Path: uunet!mimsy!chris