In order to reduce the number of commits to walk for answering the question: "Is commit B reachable from A ?",
current git version uses a simple optimization based on the association of generation numbers [1, 2, 3] to commits.
A commit's generation number is its height in the history graph, as measured from the farthest root.
This technique could also be used to increase the performance of some operations requiring to walk a revisions graph
stored in the Software Heritage archive.
That task is here to track the experiments on the subject.