GNU bug report logs -
#20029
'yes' surprisingly slow
Previous Next
Reported by: Ole Tange <tange <at> gnu.org>
Date: Sat, 7 Mar 2015 11:50:02 UTC
Severity: normal
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 10/03/15 21:18, Ole Tange wrote:
> On Tue, Mar 10, 2015 at 1:31 AM, Giuseppe Scrivano <gscrivano <at> gnu.org> 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.
This bug report was last modified 10 years and 80 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.