Subject: Re: rc_subr optimization
To: Pavel Cahyna <pavel.cahyna@st.mff.cuni.cz>
From: Luke Mewburn <lukem@NetBSD.org>
List: tech-userlevel
Date: 08/12/2004 00:14:51
--sD87aq2/Ee9ozic7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Wed, Aug 11, 2004 at 03:38:36PM +0200, Pavel Cahyna wrote:
| Hello,
|=20
| i've implemented a simple optimization of rc.subr:
|=20
| - move /etc/rc.subr to /etc/rc.subr.real
| - replace /etc/rc.subr with this:
|=20
| if ${_rc_subr_loaded:-false}; then
| :
| else
| . /etc/rc.subr.real
| _rc_subr_loaded=3Dtrue
| fi
|=20
| All rc scripts should use /etc/rc.subr as before.
|=20
| I think this should be completely transparent and avoid problems mentio=
ned
| in the log message for rev. 1.59 .
|=20
| This makes /etc/rc execute in 38 seconds (47 second before) on a
| 486DX2/50 with NetBSD 1.6. On a Pentium 100 with 2.0_BETA it saves cca 6
| seconds, on a Pentium 2 /400 MHz one second.
|=20
| I think this saving could be even more important for even slower machin=
es
| such as Vax or Motorola 68030.
|=20
| Comments?
FreeBSD has already made a similar change and notified me of it.
I hadn't had a chance to benchmark the effect, but I'll take your
results under advisement.
Cheers,
Luke.
--sD87aq2/Ee9ozic7
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (NetBSD)
iD8DBQFBGinbpBhtmn8zJHIRAsnHAJ9TKI5A8nivGHige6YBylymqj75PwCfY8Oi
mVgMk/FTWegXTfn/RxLqjJw=
=ZgeB
-----END PGP SIGNATURE-----
--sD87aq2/Ee9ozic7--