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
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
These two commands give the same output:
$ yes `echo {1..1000}` | head -c 2300M | md5sum
a0241f2247e9a37db60e7def3e4f7038 -
$ yes "`echo {1..1000}`" | head -c 2300M | md5sum
a0241f2247e9a37db60e7def3e4f7038 -
But the time to run is quite different:
$ time yes "`echo {1..1000}`" | head -c 2300M >/dev/null
real 0m0.897s
user 0m0.384s
sys 0m1.343s
$ time yes `echo {1..1000}` | head -c 2300M >/dev/null
real 0m11.352s
user 0m10.571s
sys 0m2.590s
WTF?!
I imagine 'yes' spends a lot of time collecting the 1000 args. But why
does it do that more than once?
/Ole
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.