Subject: Re: CVS commit: basesrc/bin/ksh
To: Joerg Klemenz <email@example.com>
From: Matthias Buelow <firstname.lastname@example.org>
Date: 10/04/2002 21:42:35
Joerg Klemenz writes:
> Unless performance is critical, I would rather take the "pretty"
> version, but you are right, of course.
of course... although imho the "pretty" version is using builtins ;)
> Here is what I just did:
> $ time echo $0|grep -q ksh
> 0.03s real 0.00s user 0.00s system
> $ time case $0 in *ksh) echo ksh ;; esac
> 0.01s real 0.01s user 42949672.95s system
> (System: 100MHz Intel Pentium)
That system's a speed monster compared to some boxes that NetBSD
runs on! :) Just for your amusement, as a pointless contribution to
that idle discussion, here're the times on a VAXstation 3100/m30
(~11MHz KA42 CVAX @90ns CPU):
$ time echo $0|grep -q ksh
0.51s real 0.19s user 0.21s system
$ time case $0 in *ksh) echo ksh ;; esac
0.00s real 0.00s user 0.00s system
0.5s isn't much but if you have, say, 10 checks in your profile,
it would mean that you have another 5 seconds to wait until your
prompt shows up (it already takes a couple seconds for the stty
and the tset commands I have in it).
Of course none of that matters on halfway recent hardware.
Matthias Buelow, mkb(at)informatik.uni-wuerzburg.de