Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!celit!billd From: billd@fps.com (Bill Davidson) Newsgroups: comp.bugs.4bsd Subject: Re: Bug in users command Message-ID: <14919@celit.fps.com> Date: 21 Jan 91 05:49:41 GMT References: <11104@jpl-devvax.JPL.NASA.GOV> <14902@celit.fps.com> <19095:Jan1916:41:3291@kramden.acf.nyu.edu> Organization: FPS Computing Inc., San Diego CA Lines: 34 In article <19095:Jan1916:41:3291@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >In article <14902@celit.fps.com> billd@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? No. Not really. I've always thought that "users" was a bit of a silly program to have though. I've always found "who" and "finger" to be much more useful. >30 lines of C code is hardly a maintenance problem Agreed. It would be nice if it worked properly though. >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. Huh? Your undergrads run "users" every minute? REALLY????!!!! Bizarre. Would you explain this please? --Bill Davidson