Shell performance (sh, ksh, & csh).

Bernd Felsche bernie at metapro.DIALix.oz.au
Sat Jun 22 18:18:17 AEST 1991


In <1991Jun20.213755.21433 at riacs.edu>
   dwsmith at loki.arc.NASA.GOV (David Smith) writes:

>"In spite of its increased size, ksh provides better performance.  Programs
>can be written to run faster with ksh than with either Bourne shell or the C
>shell, sometimes an order of magnitude faster."

>Does anyone have some good examples of this statement?  I know doing arithmetic
>now in the ksh is much better because it is builtin, but what about in general?

In general, ksh is slower starting, but faster executing. If you have
shell scripts with only one non-builtin command, then the Bourne shell
will very probably run it faster and more efficiently.

If your machine is tight on memory, then the Korn shell is more likely
to have part of it paged out under heavy load, slowing it down in
comparison to the smaller Bourne shell. Murphy's Law of memory
management states that the next page needed by a process is to be
paged out to make room for another EMACS :-)

The Korn shell, when used properly, can run a lot faster as it has
more builtins. Careful programming in the Bourne shell can achieve
almost the same result. Applying the same practices to the Korn shell
does not generally achieve the same spectacular performance
improvements.

Shell performance is IMHO a function of the programmer.
-- 
Bernd Felsche,                 _--_|\   #include <std/disclaimer.h>
Metapro Systems,              / sold \  Fax:   +61 9 472 3337
328 Albany Highway,           \_.--._/  Phone: +61 9 362 9355
Victoria Park,  Western Australia   v   Email: bernie at metapro.DIALix.oz.au



More information about the Comp.unix.shell mailing list