Relative speed of Bourne vs. C Shells - C Shell is faster.

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Fri Mar 29 06:54:46 AEST 1985


> On our VAX/780 running 4.2bsd, the Bourne script uses 25 seconds user CPU
> and 138 seconds system CPU.  The C Shell script uses 11 seconds user CPU
> and 4 seconds system CPU.  The Bourne script has to fork four processes
> for each loop iteration; the C Shell none.

??  I found the following:

	CSH script		SH script

	 7.2 user		 6.2 user
	 2.1 system		10.9 system

Of course, the extra "system" time is because you had the Bourne shell
execing "expr" in a loop, since it does not have arithmetic built in.
(The Korn shell does..)  In spite of this severely biased comparison,
the Bourne shell did not do badly; indeed the shell itself was quicker.

Our Cshell is essentially 4.2+BSD and the Bourne shell is SVR2 under
the BRL UNIX System V emulation.  Maybe you need a better Bourne shell?



More information about the Comp.unix.wizards mailing list