Bug in users command

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Sun Jan 20 03:41:32 AEST 1991


In article <14902 at celit.fps.com> billd at fps.com (Bill Davidson) writes:
> #!/bin/sh
> USERS=`who|sort|awk '{print $1}'`
> echo $USERS

Okay, timings: The perl version is about ten times as slow as the PD C
version and the Berkeley C version. The shell script is about twice as
slow as that. The perl version uses ten times as much memory as the C
versions, and five times as much memory as the shell script.

Now can someone give me one good reason that Berkeley should distribute
the Perl or sh version rather than the C version? 30 lines of C code is
hardly a maintenance problem, and on a system with fifty undergraduates
running automatic utmp checks every minute in the background, the
difference between C and Perl is the difference between a 2% extra load
and a 20% extra load.

---Dan



More information about the Comp.bugs.4bsd.ucb-fixes mailing list