NetBSD Problem Report #18400
Received: (qmail 121 invoked by uid 605); 24 Sep 2002 14:52:07 -0000
Message-Id: <20020924145206.6FE5511122@narn.netbsd.org>
Date: Tue, 24 Sep 2002 07:52:06 -0700 (PDT)
From: cagney@mac.com
Sender: gnats-bugs-owner@netbsd.org
Reply-To: cagney@mac.com
To: gnats-bugs@gnats.netbsd.org
Subject: Add ``i was here before'' to /etc/rc.subr
X-Send-Pr-Version: www-1.0
>Number: 18400
>Category: bin
>Synopsis: Add ``i was here before'' to /etc/rc.subr
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: lukem
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Sep 24 14:53:00 +0000 2002
>Closed-Date: Fri Jun 27 05:03:13 +0000 2003
>Last-Modified: Sat Apr 29 08:48:31 +0000 2006
>Originator: Andrew Cagney
>Release: 1.6 pure userland
>Organization:
>Environment:
Userland is pure 1.6.
>Description:
Suggest adding a ``was I here before'' test to the front of /etc/rc.subr so that every single /etc/rc.d/ script doesn't have to re-parse it. From memory, you can ``break'' out of a ``.'' script and get back to the caller.
I'm *guessing* but I think, on slow systems, it will make an overall difference to startup time.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: lukem
State-Changed-When: Fri Jun 27 05:01:23 UTC 2003
State-Changed-Why:
I've put a test-for-var-and-"return"-if-set check at the top of rc.subr.
It saves about 2 seconds across 100 runs of ". rc.subr" on a diskless
shark (strongarm 110 @ 233 mhz ?)
Responsible-Changed-From-To: bin-bug-people->lukem
Responsible-Changed-By: lukem
Responsible-Changed-When: Fri Jun 27 05:01:23 UTC 2003
Responsible-Changed-Why:
I fixed it.
(OBTW: thanks for the suggestion)
From: Andrew Cagney <cagney@mac.com>
To: gnats-bugs@gnats.netbsd.org
Cc: lukem@netbsd.org, gnats-admin@netbsd.org
Subject: Re: bin/18400
Date: Fri, 27 Jun 2003 15:59:32 -0400
> Synopsis: Add ``i was here before'' to /etc/rc.subr
>
> State-Changed-From-To: open->closed
> State-Changed-By: lukem
> State-Changed-When: Fri Jun 27 05:01:23 UTC 2003
> State-Changed-Why:
> I've put a test-for-var-and-"return"-if-set check at the top of rc.subr.
> It saves about 2 seconds across 100 runs of ". rc.subr" on a diskless
> shark (strongarm 110 @ 233 mhz ?)
out of how many seconds?
> Responsible-Changed-From-To: bin-bug-people->lukem
> Responsible-Changed-By: lukem
> Responsible-Changed-When: Fri Jun 27 05:01:23 UTC 2003
> Responsible-Changed-Why:
> I fixed it.
> (OBTW: thanks for the suggestion)
From: Luke Mewburn <lukem@netbsd.org>
To: Andrew Cagney <cagney@mac.com>
Cc: gnats-bugs@gnats.netbsd.org, lukem@netbsd.org
Subject: Re: bin/18400
Date: Sat, 28 Jun 2003 09:14:06 +1000
On Fri, Jun 27, 2003 at 03:59:32PM -0400, Andrew Cagney wrote:
| >Synopsis: Add ``i was here before'' to /etc/rc.subr
| >
| >State-Changed-From-To: open->closed
| >State-Changed-By: lukem
| >State-Changed-When: Fri Jun 27 05:01:23 UTC 2003
| >State-Changed-Why:
| >I've put a test-for-var-and-"return"-if-set check at the top of rc.subr.
| >It saves about 2 seconds across 100 runs of ". rc.subr" on a diskless
| >shark (strongarm 110 @ 233 mhz ?)
|
| out of how many seconds?
In the 'faked up' test, it went from 2.5s to 0.32s. That test was:
for i in `jot 110`; do
. /path/to/rc.subr
done
(On the same system, replacing ". /path/to/rc.subr" with ":" changes
the time to 0.06s).
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.