backward diffs in knits?

Matthieu Moy Matthieu.Moy at imag.fr
Tue Apr 10 13:11:49 BST 2007


Aaron Bentley <aaron.bentley at utoronto.ca> writes:

> Why would this make deltas smaller?
>
> If you have
>
> Text A
> 123
>
> and Text B
> 123456
>
> Then storing A and B requires storing "123" and "456" exactly once, in
> either case.  If using forward deltas, "456" is an insert associated
> with B, and "123" is part of the A snapshot.  If using backward deltas,
> "123" and "456" are both part of the B snapshot.

I believe the deltas would be smaller in a mixed snapshot+delta
situation.

Assuming you mostly add lines, 

* With forward deltas : each added line appears once in the delta
  introducing it, and once in the snapshot appearing next.

* With backward deltas : each added line appears once in the snapshot,
  and only the information that this line has to be removed appears in
  the delta for A.

IIRC, CVS has the last revision as a fulltext snapshot, and the others
as backward delta. If you only add lines during development, each line
appears only once.

-- 
Matthieu



More information about the bazaar mailing list