On Mon, Mar 23, 2009 at 7:12 AM, Dan Nicholson <dbn.li...@gmail.com> wrote: > On Fri, Mar 20, 2009 at 4:44 PM, Bruce Dubbs <bruce.du...@gmail.com> wrote: >> Dan Nicholson wrote: >>> On Fri, Mar 20, 2009 at 11:15 AM, Bruce Dubbs <bruce.du...@gmail.com> wrote: >>>> Dan Nicholson wrote: >>>> >>>>> A while back I sanitized the bootscripts for POSIX sh compatibility, and >>>>> I think DJ has been maintaining that goal. I think it's a nice (and >>>>> obtainable) goal to target since having sh != bash can save on bloat. >>>> Save on bloat? For what? My copy of bash is 500K. dash is about 80K. >>> >>> Right, bash is 4 times the size of dash. That adds up when you're forking >>> the >>> shell a hundred times or whatever during boot. >> >> Come on Dan. You know better than that. When you fork a program, the code >> segment is not duplicated, but only any necessary data. For that, there >> would >> be no significant difference between bash and dash. > > I don't honestly know how much memory is duplicated or not. Here's a > loop of shells that simply fork, do nothing and exit. > > $ time { for n in {0..100}; do /bin/bash -c :; done; } > > real 0m0.431s > user 0m0.227s > sys 0m0.191s > $ time { for n in {0..100}; do /bin/dash -c :; done; } > > real 0m0.159s > user 0m0.048s > sys 0m0.120s > > Clearly, it is taking more time for the bash shell. I know you are > going to say we're only talking about hundredths of seconds for each > run, so why should we care. But it's more than double relatively. > > If you were looking at a system (not just a computer system) and you > found that one part took twice the resources and twice as long to > start up as another part offering similar functionality, why would you > dismiss it? Maybe the original part offers better features than the > replacement, but that doesn't mean the other facts can be ignored. > >>> The last time I tested, it shaved like 4 seconds off boot using dash instead >>> of bash. >>> >>> http://linuxfromscratch.org/pipermail/lfs-support/2008-February/034192.html >> >>> I use bash all the time and I wouldn't consider using a minimal posix shell >>> for my login shell. For any non-trivial script, I use bash. However, for a >>> generic shell script, I don't know why you couldn't make it posix compliant. >>> That allows people to have flexibility without much loss. The bootscripts >>> are >>> pretty simple. >> >> As you mention, bootscripts are pretty simple and in no way are a stress >> test. >> Four seconds doesn't seem very significant to me. It's not enough to notice >> unless you are doing a timing test. > > 4 seconds out of 18 total is something I consider very significant. > For you, maybe it's not, but you are free to keep /bin/bash as > /bin/sh. However, you agree that the bootscripts are simple, so why do > you need to use bash again? > > Let's just forget about it. I think this is the second or third time > we've had this conversation and I think we just say the same things > back and forth. > > -- > Dan > -- > http://linuxfromscratch.org/mailman/listinfo/lfs-dev > FAQ: http://www.linuxfromscratch.org/faq/ > Unsubscribe: See the above information page >
The last time we decided to make everything work w/ ash (sh), There was not much benefit to utilizing bash specific features at the time. -- Nathan Coulson (conathan) ------ Location: Brittish Columbia, Canada Timezone: PST (-8) Webpage: http://www.nathancoulson.com -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page