Hi, On Mon, 14 Jul 2008, Andreas Ericsson wrote: > Johannes Schindelin wrote: > > > On Mon, 14 Jul 2008, Andreas Ericsson wrote: > > > > > Sorry for being clueless here, but why does the older versions need > > > to be kept in-memory anyway? Aren't we applying the delta each time > > > we find one, repeatedly creating a new base-object in-memory for > > > each delta? If we aren't doing that, why do we need more than just > > > a small amount of memory just for keeping the delta? > > > > Think of a delta chain of 49 delta objects, 1 base object. Now reconstruct > > all of the objects. > > > > If you do it one by one, not storing the intermediate results, you end up > > applying 1 delta for the first, 2 for the second (first the first, then the > > second), and so on, in total 1 + 2 + 3 + ... + 49 = 49 * 50 / 2 = 1225 > > times. > > > > Compare that to the 49 times when reusing the intermediate results. > > > > [...] > > while (pop_delta(patch_stack)) > apply_delta(base_object, delta); > > where "apply_delta" replaces the base_object->blob with the delta > applied, releasing the previously used memory? Delta chains are not (necessarily) independent. Ciao, Dscho -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html