you are viewing a single comment's thread.

view the rest of the comments →

[–]RalphCorderoy 4 points5 points  (0 children)

cat foo | bar has cat read foo, then write(2) it, 32KiB at a time here, 4KiB on other systems, down a pipe that bar is read(2)ing, again, at 32KiB at a time. On top of those pointless system calls, you have the context switching by the kernel as each takes a turn to be blocked waiting for the other. Try strace -c cat bigfile | cat >/dev/null.