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

Mike Taylor mat at amdahl.UUCP
Fri Mar 29 06:59:09 AEST 1985


> I'm surprised at the comments that the Bourne Shell is faster than the
> C Shell.  The 4.2bsd Bourne Shell has to call a program to add two
> numbers together, print a message, or perform an IF statment -- the C
> Shell does all that using built-in code.  Waterloo has some large shell
> scripts that would not be practical if written in Bourne format.
> 
> I don't like the C Shell bugs, but when I can work around them the C
> Shell gives me much faster performance for my large shell scripts.
> KSH recognized the cost of calling programs to do simple things (such
> as add or compare numbers), and moved all that code into the shell
> itself.   Perhaps other Bourne Shells have done this, but be sure that
> your version does before you claim it is faster than the C Shell.
>        ---- shell scripts ----

To add some more results for the given shell scripts (in seconds),

Shell  -Amdahl 470 V/8-    ----Vax11/780---
         UTS/V (SVR2)           4.2 bsd
       User System Total   User System Total
csh    1.21  0.38   1.59    11     4    15
 sh    0.96  1.76   2.72    25   138   163
ksh    0.91  2.05   2.96    --    --    --

-- 
Mike Taylor                        ...!{ihnp4,hplabs,amd,sun}!amdahl!mat

[ This may not reflect my opinion, let alone anyone else's.  ]



More information about the Comp.unix.wizards mailing list