bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20029: 'yes' surprisingly slow


From: Pádraig Brady
Subject: bug#20029: 'yes' surprisingly slow
Date: Tue, 10 Mar 2015 23:59:16 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 10/03/15 21:18, Ole Tange wrote:
> On Tue, Mar 10, 2015 at 1:31 AM, Giuseppe Scrivano <address@hidden> wrote:
> 
>> $ time src/yes `echo {1..2000}` | head -c 2000M | md5sum
>> 55c293324aa6ecce14f0bf30da5a4686  -
>>
>> real    0m7.994s
>> user    0m11.093s
>> sys     0m2.953s
>>
>> versus (with the patch):
>>
>> $ time src/yes `echo {1..2000}` | head -c 2000M | md5sum
>> 55c293324aa6ecce14f0bf30da5a4686  -
>>
>> real    0m3.534s
>> user    0m4.164s
>> sys     0m1.803s
> 
> Are you sure your are not limited by md5sum?
> 
> $ time yes "`echo {1..2000}`" | head -c 2000M >/dev/null
> 
> real    0m0.660s
> user    0m0.180s
> sys     0m1.115s
> 
> The solution should perform no worse than that.

Two separate cases. Yours above is a single large argument.
Giuseppe's example above, and your original problematic example
were without quotes, and so with many arguments passed to yes.
I've applied Giuseppe's patch with an augmented test.

cheers,
Pádraig.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]