git/builtin
Toon Claes 8d9a7cdfda last-modified: use Bloom filters when available
Our 'git last-modified' performs a revision walk, and computes a diff at
each point in the walk to figure out whether a given revision changed
any of the paths it considers interesting.

When changed-path Bloom filters are available, we can avoid computing
many such diffs. Before computing a diff, we first check if any of the
remaining paths of interest were possibly changed at a given commit by
consulting its Bloom filter. If any of them are, we are resigned to
compute the diff.

If none of those queries returned "maybe", we know that the given commit
doesn't contain any changed paths which are interesting to us. So, we
can avoid computing it in this case.

Comparing the perf test results on git.git:

    Test                                        HEAD~             HEAD
    ------------------------------------------------------------------------------------
    8020.1: top-level last-modified             4.49(4.34+0.11)   2.22(2.05+0.09) -50.6%
    8020.2: top-level recursive last-modified   5.64(5.45+0.11)   5.62(5.30+0.11) -0.4%
    8020.3: subdir last-modified                0.11(0.06+0.04)   0.07(0.03+0.04) -36.4%

Based-on-patch-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-28 16:44:58 -07:00
..
add.c Merge branch 'ds/sparse-apply-add-p' 2025-05-27 13:59:09 -07:00
am.c Merge branch 'rs/parse-options-precision' 2025-07-16 09:42:28 -07:00
annotate.c
apply.c builtin: use default hash when outside a repository 2025-07-01 14:58:24 -07:00
archive.c
backfill.c odb: rename `has_object()` 2025-07-01 14:46:38 -07:00
bisect.c
blame.c odb: rename `oid_object_info()` 2025-07-01 14:46:37 -07:00
branch.c
bugreport.c object-file: move `safe_create_leading_directories()` into "path.c" 2025-04-15 08:24:35 -07:00
bundle.c
cat-file.c Merge branch 'ps/object-store' 2025-07-15 15:18:18 -07:00
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout--worker.c
checkout-index.c
checkout.c Merge branch 'ps/object-store' 2025-07-15 15:18:18 -07:00
clean.c
clone.c odb: rename `has_object()` 2025-07-01 14:46:38 -07:00
column.c parse-options: detect mismatches in integer signedness 2025-04-17 08:15:16 -07:00
commit-graph.c Merge branch 'ps/object-store' 2025-07-15 15:18:18 -07:00
commit-tree.c odb: get rid of `the_repository` in `assert_oid_type()` 2025-07-01 14:46:35 -07:00
commit.c commit: avoid scanning trailing comments when 'core.commentChar' is "auto" 2025-07-16 08:25:17 -07:00
config.c config: mention --url in the synopsis 2025-07-01 10:28:48 -07:00
count-objects.c odb: get rid of `the_repository` in `for_each()` functions 2025-07-01 14:46:36 -07:00
credential-cache--daemon.c object-file: move `safe_create_leading_directories()` into "path.c" 2025-04-15 08:24:35 -07:00
credential-cache.c
credential-store.c
credential.c
describe.c odb: rename `oid_object_info()` 2025-07-01 14:46:37 -07:00
diagnose.c object-file: move `safe_create_leading_directories()` into "path.c" 2025-04-15 08:24:35 -07:00
diff-files.c
diff-index.c
diff-pairs.c
diff-tree.c
diff.c Merge branch 'bc/use-sha256-by-default-in-3.0' 2025-07-21 09:14:25 -07:00
difftool.c odb: rename `repo_read_object_file()` 2025-07-01 14:46:38 -07:00
fast-export.c Merge branch 'cc/fast-import-export-signature-names' 2025-07-23 15:45:16 -07:00
fast-import.c Merge branch 'cc/fast-import-export-signature-names' 2025-07-23 15:45:16 -07:00
fetch-pack.c builtin/fetch-pack: cleanup before return error 2025-06-04 08:52:25 -07:00
fetch.c Merge branch 'ph/fetch-prune-optim' 2025-07-16 09:42:27 -07:00
fmt-merge-msg.c parse-options: introduce precision handling for `OPTION_INTEGER` 2025-04-17 08:15:15 -07:00
for-each-ref.c
for-each-repo.c
fsck.c odb: rename `has_object()` 2025-07-01 14:46:38 -07:00
fsmonitor--daemon.c
gc.c Merge branch 'ps/object-store' 2025-07-15 15:18:18 -07:00
get-tar-commit-id.c
grep.c odb: rename `read_object_with_reference()` 2025-07-01 14:46:39 -07:00
hash-object.c Merge branch 'bc/use-sha256-by-default-in-3.0' 2025-07-21 09:14:25 -07:00
help.c
hook.c
index-pack.c Merge branch 'bc/use-sha256-by-default-in-3.0' 2025-07-21 09:14:25 -07:00
init-db.c Merge branch 'ps/parse-options-integers' 2025-04-24 17:25:34 -07:00
interpret-trailers.c
last-modified.c last-modified: use Bloom filters when available 2025-08-28 16:44:58 -07:00
log.c Merge branch 'ps/object-store' 2025-07-15 15:18:18 -07:00
ls-files.c odb: rename `oid_object_info()` 2025-07-01 14:46:37 -07:00
ls-remote.c builtin: use default hash when outside a repository 2025-07-01 14:58:24 -07:00
ls-tree.c odb: rename `oid_object_info()` 2025-07-01 14:46:37 -07:00
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c object-store: rename files to "odb.{c,h}" 2025-07-01 14:46:34 -07:00
merge-index.c
merge-ours.c
merge-recursive.c builtin/merge-recursive: switch to using merge_ort_generic() 2025-04-08 13:59:11 -07:00
merge-tree.c odb: rename `repo_read_object_file()` 2025-07-01 14:46:38 -07:00
merge.c merge/pull: extend merge.stat configuration variable to cover --compact-summary 2025-06-13 11:54:14 -07:00
mktag.c Merge branch 'ps/object-store' 2025-07-15 15:18:18 -07:00
mktree.c odb: rename `oid_object_info()` 2025-07-01 14:46:37 -07:00
multi-pack-index.c object-store: rename files to "odb.{c,h}" 2025-07-01 14:46:34 -07:00
mv.c Merge branch 'ps/mv-contradiction-fix' 2025-05-08 12:36:32 -07:00
name-rev.c Merge branch 'ps/object-wo-the-repository' 2025-04-15 13:50:15 -07:00
notes.c odb: rename `repo_read_object_file()` 2025-07-01 14:46:38 -07:00
pack-objects.c Merge branch 'tb/midx-avoid-cruft-packs' 2025-07-21 09:14:26 -07:00
pack-redundant.c Merge branch 'ps/object-store' 2025-07-15 15:18:18 -07:00
pack-refs.c
patch-id.c builtin: use default hash when outside a repository 2025-07-01 14:58:24 -07:00
prune-packed.c
prune.c Merge branch 'ps/object-store' 2025-07-15 15:18:18 -07:00
pull.c Merge branch 'jk/submodule-remote-lookup-cleanup' 2025-07-07 14:12:56 -07:00
push.c
range-diff.c
read-tree.c global: use designated initializers for options 2025-04-17 08:15:15 -07:00
rebase.c parse-options: add precision handling for OPTION_NEGBIT 2025-07-09 08:39:46 -07:00
receive-pack.c Merge branch 'bc/use-sha256-by-default-in-3.0' 2025-07-21 09:14:25 -07:00
reflog.c Merge branch 'ps/maintenance-reflog-expire' 2025-04-16 13:54:19 -07:00
refs.c Merge branch 'sj/ref-consistency-checks-more' 2025-03-26 16:26:10 +09:00
remote-ext.c
remote-fd.c
remote.c Merge branch 'jk/remote-avoid-overlapping-names' 2025-07-21 09:14:26 -07:00
repack.c Merge branch 'tb/midx-avoid-cruft-packs' 2025-07-21 09:14:26 -07:00
replace.c odb: rename `oid_object_info()` 2025-07-01 14:46:37 -07:00
replay.c repo_logmsg_reencode: fix memory leak when use repo_logmsg_reencode () 2025-06-05 08:35:22 -07:00
rerere.c
reset.c reset: integrate sparse index with --patch 2025-05-16 12:02:47 -07:00
rev-list.c odb: rename `oid_object_info()` 2025-07-01 14:46:37 -07:00
rev-parse.c
revert.c Merge branch 'ps/parse-options-integers' 2025-04-24 17:25:34 -07:00
rm.c rm: fix sign comparison warnings 2025-03-29 01:04:40 -07:00
send-pack.c Merge branch 'jk/fix-leak-send-pack' 2025-07-07 14:12:57 -07:00
shortlog.c Merge branch 'bc/use-sha256-by-default-in-3.0' 2025-07-21 09:14:25 -07:00
show-branch.c Merge branch 'az/tighten-string-array-constness' 2025-04-29 14:21:28 -07:00
show-index.c builtin: use default hash when outside a repository 2025-07-01 14:58:24 -07:00
show-ref.c odb: rename `has_object()` 2025-07-01 14:46:38 -07:00
sparse-checkout.c object-file: move `safe_create_leading_directories()` into "path.c" 2025-04-15 08:24:35 -07:00
stash.c Merge branch 'bc/stash-export-import' 2025-06-30 14:30:31 -07:00
stripspace.c
submodule--helper.c Merge branch 'ps/object-store' 2025-07-15 15:18:18 -07:00
symbolic-ref.c
tag.c odb: rename `repo_read_object_file()` 2025-07-01 14:46:38 -07:00
unpack-file.c odb: rename `repo_read_object_file()` 2025-07-01 14:46:38 -07:00
unpack-objects.c odb: rename `has_object()` 2025-07-01 14:46:38 -07:00
update-index.c parse-options: add precision handling for OPTION_SET_INT 2025-07-09 08:39:26 -07:00
update-ref.c refs: add function to translate errors to strings 2025-05-19 11:06:31 -07:00
update-server-info.c builtin/update-server-info: remove unnecessary if statement 2025-04-08 14:47:37 -07:00
upload-archive.c
upload-pack.c
var.c
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c Merge branch 'ly/do-not-localize-bug-messages' 2025-06-17 10:44:40 -07:00
write-tree.c parse-options: add precision handling for OPTION_BIT 2025-07-09 08:39:28 -07:00