Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #3978

Re: Detecting differences

From Nobody <nobody@nowhere.com>
Subject Re: Detecting differences
Date 2013-10-27 10:52 +0000
Message-Id <pan.2013.10.27.10.52.21.130000@nowhere.com>
Newsgroups comp.programming
References <526cdff8$0$23114$4fafbaef@reader2.news.tin.it>
Organization Zen Internet

Show all headers | View raw


On Sun, 27 Oct 2013 10:42:15 +0100, Giuliano Bertoletti wrote:

> Does it makes sense? Is there a cleverer way?

rsync uses a single level; it selects a block size based upon the size of
the file, then sends a list of hashes, one for each block. Any block
with a hash mismatch is sent in its entirety.

If you want to use multiple levels, the higher-level hashes should
be calculated over the lower-level hashes rather than over the data.

The optimum number of levels depends upon the probability of a difference.

If differences are rare, then more levels will be more efficient. For a
single difference, the asymptotically-optimal branching order is 3. If it
wasn't constrained to be an integer, it would be e = 2.71828... (the value
at which x/log(x) is a minimum).

As differences become more common, you may as well skip the first few
levels, as larger blocks will almost always have at least one difference.
In short, there's no point in sending higher-level hashes which are
likely to result in a mismatch.

If differences are extremely common, then you'll end up sending the entire
file anyhow and there's no point in sending any hashes.

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Detecting differences Giuliano Bertoletti <gbe32241@libero.it> - 2013-10-27 10:42 +0100
  Re: Detecting differences Nobody <nobody@nowhere.com> - 2013-10-27 10:52 +0000
  Re: Detecting differences malcolm.mclean5@btinternet.com - 2013-10-27 12:22 -0700

csiph-web