Skip to content

Commit 54156af

Browse files
ttaylorrgitster
authored andcommitted
t5326: test propagating hashcache values
Now that we both can propagate values from the hashcache, and respect the configuration to enable the hashcache at all, test that both of these function correctly by hardening their behavior with a test. Like the hash-cache in classic single-pack bitmaps, this helps more proportionally the more up-to-date your bitmap coverage is. When our bitmap coverage is out-of-date with the ref tips, we spend more time proportionally traversing, and all of that traversal gets the name-hash filled in. But for the up-to-date bitmaps, this helps quite a bit. These numbers are on git.git, with `pack.threads=1` to help see the difference reflected in the overall runtime. Test origin/tb/multi-pack-bitmaps HEAD ------------------------------------------------------------------------------------- 5326.4: simulated clone 1.87(1.80+0.07) 1.46(1.42+0.03) -21.9% 5326.5: simulated fetch 2.66(2.61+0.04) 1.47(1.43+0.04) -44.7% 5326.6: pack to file (bitmap) 2.74(2.62+0.12) 1.89(1.82+0.07) -31.0% Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bf4a608 commit 54156af

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

t/t5326-multi-pack-bitmaps.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,4 +283,34 @@ test_expect_success 'pack.preferBitmapTips' '
283283
)
284284
'
285285

286+
test_expect_success 'hash-cache values are propagated from pack bitmaps' '
287+
rm -fr repo &&
288+
git init repo &&
289+
test_when_finished "rm -fr repo" &&
290+
(
291+
cd repo &&
292+
293+
test_commit base &&
294+
test_commit base2 &&
295+
git repack -adb &&
296+
297+
test-tool bitmap dump-hashes >pack.raw &&
298+
test_file_not_empty pack.raw &&
299+
sort pack.raw >pack.hashes &&
300+
301+
test_commit new &&
302+
git repack &&
303+
git multi-pack-index write --bitmap &&
304+
305+
test-tool bitmap dump-hashes >midx.raw &&
306+
sort midx.raw >midx.hashes &&
307+
308+
# ensure that every namehash in the pack bitmap can be found in
309+
# the midx bitmap (i.e., that there are no oid-namehash pairs
310+
# unique to the pack bitmap).
311+
comm -23 pack.hashes midx.hashes >dropped.hashes &&
312+
test_must_be_empty dropped.hashes
313+
)
314+
'
315+
286316
test_done

0 commit comments

Comments
 (0)