SVR3 Utilities (Was: Re: small bug in who(1) of SVR3)

John F Haugh II jfh at rpp386.cactus.org
Wed Jan 16 02:27:18 AEST 1991


In article <BW2^?6- at uzi-9mm.fulcrum.bt.co.uk> igb at fulcrum.bt.co.uk (Ian G Batten) writes:
>I don't doubt it.  I had to use ``sum'' in a small utility and was
>shocked at its performance.  When I rewrote it as a function --- rather
>than running it down a pipe --- and removed some obvious infelicitudes
>it ran about three times faster.  That with, oh, half an hour's effort.

Well, I do doubt it.  Here is a collection of examples.  It should be
obvious that the pipe loses out over the single C command.  Of course,
on a system with a load average <1, waste is just fine.

% timex who -q
jfh jfh jfh root 
# users=4
execution complete

real	         0.18
user	         0.02
sys	         0.08
% timex users
jfh root
execution complete

real	         0.19
user	         0.00
sys	         0.05
% timex /bin/sh -c 'who | cut -d" " -f1 | sort -u | tr \\012 " " ; echo ""'
jfh root 
execution complete

real	         0.79
user	         0.02
sys	         0.22
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org
"While you are here, your wives and girlfriends are dating handsome American
 movie and TV stars. Stars like Tom Selleck, Bruce Willis, and Bart Simpson."



More information about the Comp.bugs.sys5 mailing list