Module diff

Module diff 

Source
Expand description

Tree diff operations for efficient incremental updates

Computes the difference between two merkle trees, identifying which hashes exist in the new tree but not the old tree. This enables efficient push operations where only changed content is uploaded.

§Key Optimization: Subtree Pruning

When a subtree’s root hash matches between old and new trees, the entire subtree is skipped - no need to traverse it since identical hash means identical content.

Structs§

DiffStats
Statistics from the diff operation
TreeDiff
Result of a tree diff operation

Functions§

collect_hashes
Collect all hashes in a tree using parallel traversal
collect_hashes_with_progress
Collect hashes with optional progress tracking
tree_diff
Compute diff between two trees
tree_diff_streaming
Streaming diff - yields hashes as they’re discovered
tree_diff_with_old_hashes
Compute diff given pre-computed old hashes