revision.c: consult Bloom filters for root commits
commit1343c893138e63e35b38324387ea790aba77a49f
authorTaylor Blau <me@ttaylorr.com>
Tue, 25 Jun 2024 17:39:13 +0000 (25 13:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Jun 2024 20:52:05 +0000 (25 13:52 -0700)
tree912f7acd6190a0801b99e96676ba528c5687d049
parentf88611c6d06ce1d2b7fe0e0ca440ff0fbbd45da8
revision.c: consult Bloom filters for root commits

The commit-graph stores changed-path Bloom filters which represent the
set of paths included in a tree-level diff between a commit's root tree
and that of its parent.

When a commit has no parents, the tree-diff is computed against that
commit's root tree and the empty tree. In other words, every path in
that commit's tree is stored in the Bloom filter (since they all appear
in the diff).

Consult these filters during pathspec-limited traversals in the function
`rev_same_tree_as_empty()`. Doing so yields a performance improvement
where we can avoid enumerating the full set of paths in a parentless
commit's root tree when we know that the path(s) of interest were not
listed in that commit's changed-path Bloom filter.

Suggested-by: SZEDER Gábor <szeder.dev@gmail.com>
Original-patch-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c
t/t4216-log-bloom.sh