[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: for; do; done regression ?
From: |
Chet Ramey |
Subject: |
Re: for; do; done regression ? |
Date: |
Fri, 07 Jan 2011 10:03:17 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 |
On 1/6/11 8:17 PM, Alexander Tiurin wrote:
> Hi!
>
> I ran the command
>
> ~$ time for i in `seq 0 10000` ; do echo /o/23/4 | cut -d'/' -f2 ; done
>> /dev/null
>
> 6 times in a row, and noticed to the increase in execution time:
>
[...]
>
> how to interpret the results?
It's hard to say without doing more investigation, but I suspect that the
fork time is increasing because the bash binary is growing in size.
I'd have to build a version with profiling enabled to tell for sure.
Since Jan brought it up, I took a release candidate for bash-4.2, dropped
the DEBUG and MALLOC_DEBUG options, and ran those commands in a script
with it. Results were consistent each run: around 9-10 seconds. This
isn't great, but it didn't exhibit the pathological degradation you saw.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/