small bug in who(1) of SVR3

Henry Spencer henry at zoo.toronto.edu
Tue Jan 15 07:20:53 AEST 1991


In article <18899 at rpp386.cactus.org> jfh at rpp386.cactus.org (John F Haugh II) writes:
>>Because they are the simplest and cheapest way to get the desired results?
>
>How can you possibly say that?  The amount of machine overhead in the
>above case is several times greater than "who -q".  In which sense is
>it "the simplest and cheapest way"?

Add up the costs of writing the C code, the costs of maintaining it, the
costs of enhancing it to add the next round of silly "features", and so
forth.  Now consider how many times per second "who" gets run, and how
critical its performance is -- i.e., not very many and not very.  The
optimization is not worth the price.

>... fork() and exec() are neither free nor even cheap - shell
>scripts are just not the right answer.

Odd; we've found that shell scripts are the right answer for an enormous
range of applications.  "ls" is a shell script on utzoo (it invokes the
Sun ls with the -1 option).  The question is not whether fork() and exec()
are free -- obviously not -- or cheap -- thanks to manufacturer stupidity
and greed, often they aren't -- but whether they are cheap *enough*.  The
answer is usually "yes".

Incidentally, it turns out that one can often rewrite Berkeley or AT&T
C programs as shell files and find that they run *faster*.
-- 
If the Space Shuttle was the answer,   | Henry Spencer at U of Toronto Zoology
what was the question?                 |  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.bugs.sys5 mailing list