Skip to main content

Module diff

Module diff 

Source
Expand description

Structural diff of two Prolly trees.

The diff walks both trees simultaneously. Any pair of child CIDs that compare equal is pruned immediately - the subtrees are byte-identical by construction, so they cannot contain any differences. This is the Prolly payoff: a 10,000-entry tree with 10 edits is diffed by touching only the O(d × log n) chunks on the edited paths, not the whole tree.

Output is a Vec<DiffEntry> sorted ascending by key. Entries describe insertions, removals, and value changes from a to b.

Enums§

DiffEntry
A single difference between two Prolly trees.

Functions§

diff
Compute the difference between the two Prolly trees a and b.