From: cmr@world.std.com (Charles M Richmond)
Subject: Re: Copyright irritation (OSF/1) on *everything*
Date: 1995/04/05 [thread overview]
Message-ID: <D6JHI5.DzG@world.std.com> (raw)
In-Reply-To: 3lrrt3$hb3@topaz.sensor.com
ron@topaz.sensor.com (Ron Natalie) writes:
>#!/bin/sh
>usage="Usage: $0 [OPTION]...
> --help display this help and exit
> --version output version information and exit"
>case $# in
> 1 )
> case "z${1}" in
> z--help )
> echo "$usage"; exit 0 ;;
> z--version )
> echo "GNU shellutils 1.9.4"; exit 0 ;;
> * ) ;;
> esac
> ;;
> * ) ;;
>esac
>exit 0
If I put this in a file called ture and then execute:
time (ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture
;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture
;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture
;ture;ture)
The result is :
real 0m4.43s
user 0m1.03s
sys 0m3.30s
Whereas Digitals 16k executable in the same circumstance is:
time (true;true;true;true;true;true;true;true;true;true;true;true;true;true;true
;true;true;true;true;true;true;true;true;true;true;true;true;true;true;true;true
;true;true;true;true;true;true;true;true;true;true;true;true;true;true;true;true
;true;true)
real 0m0.03s
user 0m0.01s
sys 0m0.01s
Which is one hell of a lot faster!
If I strip the weirdness out of the shell and just do
#!/bin/sh
exit 0
time (rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute
;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute
;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute
;rute;rute)
real 0m4.20s
user 0m0.95s
sys 0m3.13s
I guess if I was putting Linux or freeBSD on a *tiny* disk drive then I
might object to the extra 16k with the multi-gig system that I have ...
I much prefer the 100 to 1 speed improvement. Now this applies to repetitive
scripts, but there does not seem to be much else that 'true' is good for.
I note that on the DS3100 that true is "an exported alias for :" and that
it executes the same # of times in:
real 0m0.03s
user 0m0.00s
sys 0m0.01s
If I explicitly use /bin/true, then :
real 0m4.38s
user 0m0.40s
sys 0m1.75s
and a compiled version:
real 0m1.95s
user 0m0.11s
sys 0m1.53s
Charlie
--
*****************************************************************************
* Charles Richmond Integrated International Systems Corporation *
* cmr@asoko.iisc.com cmr@world.std.com *
* Specializing in UNIX, X, Image Processing, and Communications. *
next prev parent reply other threads:[~1995-04-05 4:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-04-02 5:00 Copyright irritation (OSF/1) on *everything* C. Titus Brown
1995-04-02 5:00 ` Daniel S. Riley
1995-04-02 5:00 ` Titus Purdin
1995-04-02 5:00 ` John L. Henning
1995-04-03 4:00 ` Ron Natalie
1995-04-07 4:00 ` Ian Dall
1995-04-10 4:00 ` Sean Donelan
1995-04-10 4:00 ` Dan Pop
1995-04-11 4:00 ` Steven Kirby
1995-04-12 4:00 ` Pete Halverson
1995-04-12 4:00 ` Carlie Coats
1995-04-02 5:00 ` Ron Natalie
1995-04-03 4:00 ` Matthias Bruestle
1995-04-04 4:00 ` Ron Natalie
1995-04-05 4:00 ` Charles M Richmond [this message]
1995-04-04 4:00 ` Dan Pop
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox