В Срд, 15/10/2008 в 20:51 +0100, Steve Long пишет: > >> for ((i=0;i<100000;i++)); do echo /usr/share/doc/${P}/examples > > >> /dev/null; > > > >> real 11.25 > > > >> real 9.24 > > > > So that's what, on the order of 20 microseconds faster for each iteration? > > > Or ~18%. (You shouldn't use the first iteration in general, btw.)
Steve, your example only tests how much time bash takes to parse string. It's obvious that in quoted strings some expansions could be avoided and thus bash works faster. But although ebuilds use bash syntax they are interpreted not only by bash - the time to parse stings is negligible to other activities. I have not calculated but made a rough estimation taking into account the number of ebuilds in the tree. So I think we have of order of 10^6 string. This means that during merge of all packages we'll win 10 seconds. I don't think it's worth to consider this gain. So in portage tree this is the matter of style. That's said, since personally I don't have any preference on this style and until there will be arguments not to use this style I'll start to use full quotation of the strings. And yes, in pure bash programs possibly this'll make sense. -- Peter.