Mailinglist Archive: opensuse-packaging (130 mails)

< Previous Next >
Re: [opensuse-packaging] Proposal for a shell scripting policy
  • From: Guido Berhoerster <guido+opensuse.org@xxxxxxxxxxxxxxxx>
  • Date: Tue, 23 Mar 2010 23:09:12 +0100
  • Message-id: <20100323220912.GE7496@xxxxxxxxxxxxxxxxxx>
* Lubos Lunak <l.lunak@xxxxxxx> [2010-03-23 22:04]:
Well the "claim" acutally comes from the bash maintaines, read
bash(1) BUGS. One example is startup time, try libmicro's system
benchmark
/usr/lib/libMicro/bin/system -E -C 200 -L -S -W -N "system" -I 1000000
with /bin/sh as a link to ksh or dash and empty .profile/ENV.
dash is 2,5 times and ksh93 is still 1,5 times faster. I have
anecdotal evidence that pattern matching while processing
textfiles is significantly slower in bash compared to ksh93/dash.

Speaking of anecdotes, there is one I remember from the times of the
communist regime about plans set up by the party: "Our farm has completed the
5-year plan at 200%. We have four chickens instead of two."

Another area in which bash is bad at and which matters even more
are subshells, for a rough estimate try
time $shell -c 'i=0; while [ $i -lt 10000 ]; do $(a=$$); i=$((i+1)); done'
with bash, dash, and ksh93. Here dash is 3 times faster and ksh93
37 times faster than bash (ksh93 shines here because it does not
actually use a subprocess).

Let me give you a piece of advice: If you want to argue by technical
arguments, then do so. "37 times faster", without anything else, is
like "hair 87% more shiny" ads. If better performance should be a reason to
avoid bashism, then say how big improvements you actually expect, and provide
some real numbers to support that. "37 times faster" is completely
unimpressive if it in practice may mean that this change will save quarter of
a second of boot time.

And your point is? Firstly, the original question was whether
there is evidence that bash is slow and where that matters, I
think I have answered that. Secondly, this is not about boot
speed, shell scripting has more use cases than simple boot
scripts. And thirdly, speed advantages were only one, not the
main rationale for my proposal.

--
Guido Berhoerster
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >