1

Here I read, in the comments, that a guy got more performance when used dd in pipeline for a copy. Like for example:

dd if=in | dd of=out

instead of

dd if=in of=out

Is it really faster? Why? Also: he talked about symmetric and asymmetric copying. Could someone explain-me this better, please?

sl34x
  • 23
  • 4

1 Answers1

3

This was an interesting question, so I did some tests. From my testing - copying within the same disk was actually slower using the pipe (significantly - 40 as opposed to 30 seconds, reproduced multiple times.

When I did something similar between disks (in this case a hard drive and USB key) there was no discernible difference in the time.

Thus I conclude that for the general case, no its not faster, and may even be slower, however there may be some corner cases where it could be faster.

I think what the author meant by symmetric/asymmetric was synchronous/asynchronous - IE in the case of "dd if=in of=out" it read data, and when that was done [ for a block ] it wrote the data, and repeated until this process was complete. In the second instance he infers that he read the data and then, while it was reading, wrote the data to the second disk using a stream. This is plausible - although my tests did not bear out a speed increase - of-course I can think of lots of variations to try, some of which may, indeed be faster - although I'd speculate using larger block sizes is a better way to get a speed increase.

davidgo
  • 5,964
  • 2
  • 21
  • 38