Optimizing RCng execution speed ?

Peter Jeremy PeterJeremy at optushome.com.au
Tue Apr 13 13:00:36 PDT 2004


On Tue, Apr 13, 2004 at 12:03:31PM -0400, Brian Reichert wrote:
>On Mon, Apr 12, 2004 at 04:16:29PM -0700, Tim Kientzle wrote:
>> Poul-Henning Kamp wrote:
>> >
>> >Is anybody working on optimizing RCng execution speed ?
>> >
>> >I think our boottime is getting a bit too slow these days...
>
>Would 'compiling' some/all of the scripts be useful?

My gut feeling is "probably not".  Most of the rc scripts are
fairly trivial and amount to
	source configuration information and subroutines
	if action == "start" and my_config_variable != "NO"
		run some daemon
	elif action == "stop" and my daemon is running
		kill it
	endif
The time-consuming bits are starting a new shell and sourcing the
config files.  The config files can't be (totally) compiled in
because rc.conf needs to be user-configurable at runtime.  In
addition, the scripts themselves include magic comments used to
define dependency ordering so they must still exist.

If you feel that CCsh might help, why not whip up a prototype
implementation and time it.

As a general comment on this thread, my feeling is that optimising
boot speed is not the most productive use of scarce developer time
at present (though I agree it can be annoying if you need to reboot
regularly to test fixes).  If someone wants to have a look at this,
the place to start is to profile the complete system during startup
and see where the time is going.

Peter


More information about the freebsd-current mailing list