pub struct ChainCache { /* private fields */ }Expand description
A bounded memo of materialised entries by archive offset, for a reader that walks many neighbouring chains — the reachability builder reads (nearly) every tree of a repository once, and in a packed repository most trees are deltas against the tree before them. Without it a chain of depth d costs d inflates and d−1 delta applications per object, every time (MEASURED, git.git on dwarf: 330 535 tree reads, 27 s of a 33 s build). With it the outward walk stops at the first link already materialised.
FIFO by bytes, not LRU: the bases a packed chain reaches are the entries written just before it, so recency of insertion is the right order. An archive is append-only, so an offset’s bytes never change under the memo; a gc rewrites into a NEW generation, and this is never held across one.