Is there any good reason why the third command in the listing below is so slow?
And, more importantly, is there any way to make it run at comparable speed with the first two?
a@DESKTOP-OCHDMBI MINGW64 ~
$ time head -c 1G </dev/zero >/dev/null
real 0m0.141s
user 0m0.109s
sys 0m0.000s
a@DESKTOP-OCHDMBI MINGW64 ~
$ time head -c 1G </dev/zero | cat >/dev/null
real 0m0.221s
user 0m0.171s
sys 0m0.263s
a@DESKTOP-OCHDMBI MINGW64 ~
$ time cat </dev/zero | head -c 1G | cat >/dev/null
real 0m2.065s
user 0m0.608s
sys 0m3.185s
The practical interest behind this question is running pigz
in MINGW that is strangely slow, presumably because MINGW is not feeding the input data to it fast enough.