Re: [dwm] bold in status text

From: Julian Romero <julian.romero+dwm_AT_gmail.com>
Date: Thu, 24 Aug 2006 15:32:32 +0200

On 8/24/06, Ross Mohn <rpmohn_AT_waxandwane.org> wrote:
> On Thu, 2006-08-24 at 07:45 -0500, Kurt Maier wrote:
> > > Alexander:
> > > Is conky resource-friendly?
> >
> > to be honest, I used to have a bash script that did similar things to
> > get the readout I posted earlier. The reason I switched to conky is
> > because I felt that a single compiled program would probably be a
> > little more resource-friendly that spawning a million bash, sed, and
> > awk processes every five seconds. ;)
> >
> > Turns out, after a little testing on my PIII 1.2 GHz, there's not a
> > huge amount of difference in resource-usage either way.
>
> Speaking of resources, I wonder how the resource requirements of these
> two statements compare? They both give the same result. How would I test
> this?
>
> uptime | sed 's/.*: //; s/,//g'
> cat /proc/loadavg | sed 's/ [0-9]*\/.*//'
>
> -RPM
>
>
this can give you an idea:

MAX=999

time (n=0;while(true);do uptime|sed 's/.*: //; s/,//g' > /dev/null;let
n=`expr $n + 1`;if [ $n -eq $MAX ];then
break; fi;done)

time (n=0;while(true);do cat /proc/loadavg | sed 's/ [0-9]*\/.*//' >
/dev/null;let n=`expr $n + 1`;if [ $n -eq
 $MAX ];then break; fi;done)

time (n=0;while(true);do cat /proc/loadavg | cut -d" " -f1-3 >
/dev/null;let n=`expr $n + 1`;if [ $n -eq $MAX ]
;then break; fi;done)

Not real difference. Second one seems slightly slower.

-- 
Julián
Received on Thu Aug 24 2006 - 15:32:34 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:30:27 UTC