Subject: rc_subr optimization
To: None <tech-userlevel@netbsd.org>
From: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
List: tech-userlevel
Date: 08/11/2004 15:38:36
Hello,

i've implemented a simple optimization of rc.subr:

- move /etc/rc.subr to /etc/rc.subr.real
- replace /etc/rc.subr with this:

if ${_rc_subr_loaded:-false}; then
	:
else
	. /etc/rc.subr.real
	_rc_subr_loaded=true
fi

All rc scripts should use /etc/rc.subr as before.

I think this should be completely transparent and avoid problems mentioned
in the log message for rev. 1.59 .

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.

I think this saving could be even more important for even slower machines
such as Vax or Motorola 68030.

Comments?