Rsync Speed-up

Online docs say that rsync sends only the differences and “information about structure” but my experience seems to indicate otherwise. So I ran a little test too on a file where I just changed the timestamp without changing the file contents:

$ cp -a testfile-100M destfile

$ rsync -av testfile-100M destfile
sending incremental file list

sent 56 bytes received 12 bytes 8.00 bytes/sec
total size is 104857600 speedup is 1542023.53

$ touch testfile-100M

$ rsync -av testfile-100M destfile sending incremental file list
testfile-100M

sent 104870495 bytes received 31 bytes 113804.15 bytes/sec
total size is 104857600 speedup is 1.00

I didn’t time it, but the initial cp easily took 1/3rd the time the final rsync did–I would estimate more like 1/4th or 1/5th the time. I’ve always read “speedup is 1.00″ as “this is equivalent to having copied the whole file.” Meaning I gained no speedup over just transmitting the file regularly, as calculated by the algorithm.

I think what might be going on is that when rsync sees the timestamp has changed it transfers the file. But in doing so, it does a diff on the contents which is slower than just copying a file.