However, I doubt your network speed is consistent enough to read much into the difference between 15.9 seconds and 15.5. If you're curious, run it a few dozen times and see how much it varies. I suspect you'll find this variation makes it impossible to measure any pipe overhead. Even ignoring that variable, the difference between times will still be dominated by the issues mentioned parenthetically in the previous paragraph.
I'm not really sure what you're looking for. What kind of measurement could be considered a "cost" of piping? Difference in setup time perhaps? You might measure that with a homebrew script and a carefully constructed command line, but what good would it do you?
tl;dr - your question is not well defined.
]]>If I run two parts separately, as: time gzip -fc1 file.tar > new; time cat new | ssh armend@server "cat > /dev/null"....
My time of execution ~9 seconds to compress and 15.5 seconds to send.
</end smartass comment>
]]>If you did run and time them separately, the results would (probably) add up to more than the total time of the piped operation.
]]>For example.. I am using following command:
time gzip -kfc1 file.tar | ssh armend@xeon-server "cat > /dev/null"
It compresses a file on one computer and sends it to another over wireless connection (16Mbps). Entire command finishes in about 15 seconds.
I am would like to know the time it takes to do "gzip -kfc1 file.tar" and "ssh armend@xeon-server "cat > /dev/null" " portions.. or compression and wireless transfer portions?
How can I separate those two part? I guess I can estimate the cost of wireless transfer based on network transfer speeds, but I am would like to do know if this would somehow cut into real execution time of first task.
Running two task separately adds extra overhead since I am writing output of first tast to drive and then use cat (with pipe) to send it over wireless network.
]]>