Skip to main content

diff

Function diff 

Source
pub fn diff(
    store: &Store,
    before: &Cid,
    after: &Cid,
) -> Result<Diff, StoreError>
Expand description

Diffs two trees held in one store.

Both roots are walked whole, which is the obvious implementation and not the clever one. A production diff would descend the two trees together and skip the subtrees whose CIDs already match; this reads every node of both. For a repository-sized tree that is the difference between a proof and an export, and it is the right trade here — the operation is checked against sixteen thousand vectors, and the version that is obviously correct is the one worth checking them against.