diff options
author | Jeff King <peff@peff.net> | 2020-02-14 13:22:36 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-14 10:46:22 -0800 |
commit | 4f3bd5606a02260274555f41fd7d6368f2bea1d8 (patch) | |
tree | 7381751821da253c015904fcb289ea31eeaea26e /t/perf/p5310-pack-bitmaps.sh | |
parent | bitmap: add bitmap_unset() function (diff) | |
download | tgif-4f3bd5606a02260274555f41fd7d6368f2bea1d8.tar.xz |
pack-bitmap: implement BLOB_NONE filtering
We can easily support BLOB_NONE filters with bitmaps. Since we know the
types of all of the objects, we just need to clear the result bits of
any blobs.
Note two subtleties in the implementation (which I also called out in
comments):
- we have to include any blobs that were specifically asked for (and
not reached through graph traversal) to match the non-bitmap version
- we have to handle in-pack and "ext_index" objects separately.
Arguably prepare_bitmap_walk() could be adding these ext_index
objects to the type bitmaps. But it doesn't for now, so let's match
the rest of the bitmap code here (it probably wouldn't be an
efficiency improvement to do so since the cost of extending those
bitmaps is about the same as our loop here, but it might make the
code a bit simpler).
Here are perf results for the new test on git.git:
Test HEAD^ HEAD
--------------------------------------------------------------------------------
5310.9: rev-list count with blob:none 1.67(1.62+0.05) 0.22(0.21+0.02) -86.8%
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/perf/p5310-pack-bitmaps.sh')
-rwxr-xr-x | t/perf/p5310-pack-bitmaps.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/perf/p5310-pack-bitmaps.sh b/t/perf/p5310-pack-bitmaps.sh index e52f66ec9e..936742314c 100755 --- a/t/perf/p5310-pack-bitmaps.sh +++ b/t/perf/p5310-pack-bitmaps.sh @@ -47,6 +47,11 @@ test_perf 'rev-list (objects)' ' git rev-list --all --use-bitmap-index --objects >/dev/null ' +test_perf 'rev-list count with blob:none' ' + git rev-list --use-bitmap-index --count --objects --all \ + --filter=blob:none >/dev/null +' + test_expect_success 'create partial bitmap state' ' # pick a commit to represent the repo tip in the past cutoff=$(git rev-list HEAD~100 -1) && |