Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Aug 2002 09:57:26 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        rizzo@icir.org
Cc:        nbm@mithrandr.moria.org, arch@FreeBSD.ORG
Subject:   Re: ugliness in rc.* scripts
Message-ID:  <20020821.095726.109035410.imp@bsdimp.com>
In-Reply-To: <20020821061822.A56560@iguana.icir.org>
References:  <20020820232538.A53816@iguana.icir.org> <20020821074819.GA58163@mithrandr.moria.org> <20020821061822.A56560@iguana.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20020821061822.A56560@iguana.icir.org>
            Luigi Rizzo <rizzo@icir.org> writes:
: On Wed, Aug 21, 2002 at 09:48:19AM +0200, Neil Blakey-Milner wrote:
: ...
: > > This would be easily fixed by moving /usr/bin/tr to /bin/tr (statically
: > > linked) and doing
: > > 
: > > 	tolower() {
: > > 	    echo `tr A-Z a-z <<_EOF
: > > 	$*`
: > > 	}
: > > 
: > > 	case `tolower ${some_config_variable}` in
: > > 	mixed_case_string)
: ...
: > I believe the argument for 'case' and those mixed case strings is that
: > it doesn't spawn a process, whereas "if [ " did at the time.  Using
: > 'echo' and 'tr' and two ``'s will spawn four shells (or something like
: > that).
: 
: i think it is only one process -- echo is a builtin, tolower is a shell
: function. In any case, we never cared about performance in the rc scripts,
: not spawning processes (e.g. calling scripts with . instead of sh) has
: only to do with letting variable assignements be visible in the caller.

Actually, we have cared about the performance of shell scripts in the
past.  NetBSD got a nasty surprise when they went to their new rc
system when they started greatly increasing the number of forks in the
boot process.  Some machines went from taking 10 seconds to boot to
taking 30 minutes.  They fixed this in two ways: 1) by reducing the
number of forks in the rc scripts and 2) by fixing bugs in that
architecture that make fork insanely slow.

We still need to boot fast enough that things aren't insanely slow on
a 32MB 66MHz 486.  There's enough embedded people doing embedded
things that will likely want 5.0 that we have to keep that in mind.
The company I work for has systems with 133MHz 486-class CPUs that we
ship with 32MB RAM.

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020821.095726.109035410.imp>