Subject: Re: ksh bugs and behaviour questions
To: None <tech-userlevel@netbsd.org>
From: James K. Lowden <jklowden@schemamania.org>
List: tech-userlevel
Date: 01/25/2003 12:56:27
On Wed, 22 Jan 2003 22:59:04 -0500, Roland Dowdeswell <elric@imrryr.org>
wrote:
> Julio Merino wrote:
> >A more specific question is... which is the reason of having two
> >bourne shells, ksh and sh?
> 
> 	$ time sh -c 'for i in $(jot 10000); do /bin/echo -n; done' 
> 	   12.43s real     0.56s user     6.35s system
> 	$ time ksh -c 'for i in $(jot 10000); do /bin/echo -n; done'
> 	   19.32s real     1.78s user    11.91s system
> 
> 	i.e. speed.

Hmm.  Or for true slowness, you could use bash:

$ time sh -c 'for i in $(jot 10000); do /bin/echo -n; done' 
       11.52 real         0.47 user         5.07 sys
$ time ksh -c 'for i in $(jot 10000); do /bin/echo -n; done'
       14.38 real         0.68 user         7.12 sys
$ time bash -c 'for i in $(jot 10000); do /bin/echo -n; done'
       22.95 real         1.88 user        12.71 sys

I was surprised by two things:

1.  system time for bash is 2X vs. sh.
2.  Roland has such a pokey machine.  

--jkl