Parallelizing bootscripts [was: Make bootscripts more POSIX compliant]
bruce.dubbs at gmail.com
Tue Feb 20 14:18:14 PST 2007
Dan Nicholson wrote:
> Let's analyze it a different way. It takes over twice as long to
> initialize and close a bash shell than a dash shell. Why do that when
> you don't have to? It's a simple optimization.
We had an old saying in the military: Measure with a micrometer, mark it
with a grease pencil, cut it with an axe. It strikes me that this is
what is happening here.
Let me reiterate that I have no objections to doing this as an
intellectual exercise. I'm just saying that the results will not be
noticeable by the casual user, even if they can be measured with a watch
or by internal measurements.
>> The memory space is generally not significant either because only one
>> copy of the code is in memory at any time. The difference would be data
> It's not the amount of memory that's the problem. But you're
> constantly loading and unloading 6 times as much memory. I'd say that
> accounts for the difference above.
No, no, no. That's not how Linux memory works. When a program is
terminated, the kernel keeps it in memory as long as possible after the
last instance using it is finished. If the program is called while it
is still in memory, it doesn't have to be reloaded. Generally it only
gets thrown out if all memory, including swap, is needed for something
else. It is the first to be put in swap if it is unused though.
Generally, something like an often used program like a shell would
always be in memory or, at worst, swap.
More information about the lfs-dev