aboutsummaryrefslogtreecommitdiff
path: root/t/perf/lib-bitmap.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-09-05 18:33:39 -0700
committerJunio C Hamano <gitster@pobox.com>2022-09-05 18:33:39 -0700
commit3fe0121479ea340936d11927efa5a45a4e1e39cc (patch)
tree8c2bc27b33f476356ed6e2dbba1ce7be20d5cebd /t/perf/lib-bitmap.sh
parentcf98b69053996728f131671ed7ff9581b0e8943a (diff)
parent969a5645876ccf368ed74fde2c5dc9b5432b7bb0 (diff)
downloadgit-3fe0121479ea340936d11927efa5a45a4e1e39cc.tar.xz
Merge branch 'ac/bitmap-lookup-table'
The pack bitmap file gained a bitmap-lookup table to speed up locating the necessary bitmap for a given commit. * ac/bitmap-lookup-table: pack-bitmap-write: drop unused pack_idx_entry parameters bitmap-lookup-table: add performance tests for lookup table pack-bitmap: prepare to read lookup table extension pack-bitmap-write: learn pack.writeBitmapLookupTable and add tests pack-bitmap-write.c: write lookup table extension bitmap: move `get commit positions` code to `bitmap_writer_finish` Documentation/technical: describe bitmap lookup table extension
Diffstat (limited to 't/perf/lib-bitmap.sh')
-rw-r--r--t/perf/lib-bitmap.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/perf/lib-bitmap.sh b/t/perf/lib-bitmap.sh
index 63d3bc7cec..55a8feb1dc 100644
--- a/t/perf/lib-bitmap.sh
+++ b/t/perf/lib-bitmap.sh
@@ -67,3 +67,34 @@ test_partial_bitmap () {
--filter=tree:0 >/dev/null
'
}
+
+test_pack_bitmap () {
+ test_perf "repack to disk" '
+ git repack -ad
+ '
+
+ test_full_bitmap
+
+ 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) &&
+ orig_tip=$(git rev-parse HEAD) &&
+
+ # now kill off all of the refs and pretend we had
+ # just the one tip
+ rm -rf .git/logs .git/refs/* .git/packed-refs &&
+ git update-ref HEAD $cutoff &&
+
+ # and then repack, which will leave us with a nice
+ # big bitmap pack of the "old" history, and all of
+ # the new history will be loose, as if it had been pushed
+ # up incrementally and exploded via unpack-objects
+ git repack -Ad &&
+
+ # and now restore our original tip, as if the pushes
+ # had happened
+ git update-ref HEAD $orig_tip
+ '
+
+ test_partial_bitmap
+}