[arch-general] Bashification of initscripts for moderate speedup

Victor Lowther victor.lowther at gmail.com
Tue Jun 29 12:54:47 EDT 2010


On Jun 28, 2010, at 11:36 AM, Isaac Dupree <ml at isaac.cedarswampstudios.org 
 > wrote:

> On 06/28/10 09:35, Victor Lowther wrote:
>> On Jun 28, 2010, at 7:42 AM, Caleb Cushing  
>> <xenoterracide at gmail.com> wrote:
>>
>>> On Sun, Jun 27, 2010 at 11:10 PM, Victor Lowther
>>> <victor.lowther at gmail.com> wrote:
>>>> Questions, comments, flames, etc. welcome.
>>>
>>> why go this way instead of the other? (clarification why go deeper
>>> into bash instead of trying to posix-ify the scripts)
>>
>> ...and the main
>> source of slowdowns in the boot sequence is I/O based -- mounting
>> filesystems and launching programs.
>
> IIRC, Busybox shell can get notable speed boost by incorporating  
> versions of tools like sed into the same busybox executable, such  
> that it often doesn't have to fork and load other short-lived  
> programs.

You can eliminate a fair number of trivial uses of grep, awk, and sed  
by using all of the parameter expansion modifiers that bash offers,  
and by using the native regex support from bash 3 and above. I made  
these changes wherever it seemed appropriate in my changes.

>
> (I believe it doesn't do bash-array-syntax.)
>
> -Isaac


More information about the arch-general mailing list