[arch-general] Bashification of initscripts for moderate speedup

Victor Lowther victor.lowther at gmail.com
Sun Jun 27 23:10:20 EDT 2010


I have spent some time over the last month or so rewriting the Arch
initscripts in idiomatic bash -- since they rely on bash-specific
features, trying to keep them fairly POSIX is rather a waste of time and
a net performance loss -- using bash-style conditionals is about 30%
faster when nothing needs to be touched on the filesystem and about 200%
easier to read, and you can use bash regexps in place of most trivial
uses of sed, grep, and awk when mangling parameters or variables -- the
fewer short-lived processes we fork the better.

You can browse changes I have made in the git repo @
http://git.fnordovax.org/arch-initscripts/log/?h=bashification and you
can checkout my changes to play around with from
git://fnordovax.org/~victor/arch-initscripts 

There is a gigantic whitespace fixup patch at the end, all it does is
fix all the whitespace errors I introduced while hacking and reformat
everything to a consistent indentation style (emacs shell-script mode,
if you are interested).

I have tested these changes on a VM and on my local laptop.  I inlcuded
a PKGBUILD that will build an initscripts-git package, but be sure to
backup and restore your rc.*local, inittab, and rc.conf files because
they will get nuked the first time you install it.

Questions, comments, flames, etc. welcome. I can also spam the list with
patches if y'all really want.
-- 
Victor Lowther
LPIC2 UCP RHCE 


More information about the arch-general mailing list