]> git.ipfire.org Git - thirdparty/git.git/commit - pack-bitmap.c
pack-bitmap.c: support 'tree:0' filtering
authorTaylor Blau <me@ttaylorr.com>
Mon, 4 May 2020 23:12:35 +0000 (17:12 -0600)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 May 2020 04:57:58 +0000 (21:57 -0700)
commitb0a8d4820baa9966511ea9bd8c8b09dab087475f
tree33983aff8435137b78930fccf5a546fd6a6da097
parent856e12c18a4616bbfbdfd1777577c1182b148519
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 <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap.c
t/perf/p5310-pack-bitmaps.sh
t/t6113-rev-list-bitmap-filters.sh