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

BALDWIN mike at whuxl.UUCP
Thu Mar 28 13:58:33 AEST 1985


> I too am sick and tired of hearing about how much faster the bourne shell
> is than the C shell. On a heavily loaded VAX my C shell scripts always run
> faster, and when the load drops to around 1 the two shells seem to run neck
> and neck. Some people say bourne shell is easier to program, come on, does
> "if test $# -gt 1" really look better than "if ($#argv > 1)" and tell me you
> don't cringe every time you type esac and fi (yuk yuk). Here are two shell
> scripts (made to make tail act like head) go ahead, run em, make my day..
> ---seismo!tiberio

OK, I did run 'em.  Ten times, on twenty files each time.  The results
of the time command are:
								   total
sh:
real   3.3   2.9   2.9   2.9   2.9   2.9   2.9   2.9   2.9   3.0   29.5
user   0.7   0.8   0.8   0.7   0.7   0.7   0.7   0.7   0.7   0.8   7.3
sys    2.1   1.9   2.0   2.1   2.0   2.0   2.0   2.0   2.1   2.0   20.2

csh:
real   8.4   5.9   5.9   7.8   5.9   5.9   5.9   6.1   6.0   5.9   63.7
user   2.9   2.9   2.8   2.8   2.9   2.9   2.8   2.9   2.8   2.8   28.5
sys    3.0   2.8   2.9   2.9   2.9   2.9   2.9   2.9   2.9   3.0   29.1

Relative speed comparison:

      sh/csh

real  46.3%
user  25.6%
sys   69.4%

This is with the SVR2 sh, by the way.  I'm not sick and tired of people
making false claims (people always will), I'm just amused.

							Michael Baldwin
							whuxl!mike



More information about the Comp.unix.wizards mailing list