path: root/t/perf/
diff options
authorTaylor Blau <>2020-05-04 23:12:35 (GMT)
committerJunio C Hamano <>2020-05-05 04:57:58 (GMT)
commitb0a8d4820baa9966511ea9bd8c8b09dab087475f (patch)
tree33983aff8435137b78930fccf5a546fd6a6da097 /t/perf/
parent856e12c18a4616bbfbdfd1777577c1182b148519 (diff)
pack-bitmap.c: support 'tree:0' filtering
In the previous patch, we made it easy to define other filters that exclude all objects of a certain type. Use that in order to implement bitmap-level filtering for the '--filter=tree:<n>' filter when 'n' is equal to 0. The general case is not helped by bitmaps, since for values of 'n > 0', the object filtering machinery requires a full-blown tree traversal in order to determine the depth of a given tree. Caching this is non-obvious, too, since the same tree object can have a different depth depending on the context (e.g., a tree was moved up in the directory hierarchy between two commits). But, the 'n = 0' case can be helped, and this patch does so. Running p5310.11 in this tree and on master with the kernel, we can see that this case is helped substantially: Test master this tree -------------------------------------------------------------------------------- 5310.11: rev-list count with tree:0 10.68(10.39+0.27) 0.06(0.04+0.01) -99.4% Signed-off-by: Taylor Blau <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/perf/')
1 files changed, 5 insertions, 0 deletions
diff --git a/t/perf/ b/t/perf/
index 80c53ed..75ccf9f 100755
--- a/t/perf/
+++ b/t/perf/
@@ -53,6 +53,11 @@ test_perf 'rev-list count with blob:limit=1k' '
--filter=blob:limit=1k >/dev/null
+test_perf 'rev-list count with tree:0' '
+ git rev-list --use-bitmap-index --count --objects --all \
+ --filter=tree:0 >/dev/null
test_perf 'simulated partial clone' '
git pack-objects --stdout --all --filter=blob:none </dev/null >/dev/null