Skip to content

Commit 2d59597

Browse files
ttaylorrgitster
authored andcommitted
p5326: perf tests for MIDX bitmaps
These new performance tests demonstrate effectively the same behavior as p5310, but use a multi-pack bitmap instead of a single-pack one. Notably, p5326 does not create a MIDX bitmap with multiple packs. This is so we can measure a direct comparison between it and p5310. Any difference between the two is measuring just the overhead of using MIDX bitmaps. Here are the results of p5310 and p5326 together, measured at the same time and on the same machine (using a Xenon W-2255 CPU): Test HEAD ------------------------------------------------------------------------ 5310.2: repack to disk 96.78(93.39+11.33) 5310.3: simulated clone 9.98(9.79+0.19) 5310.4: simulated fetch 1.75(4.26+0.19) 5310.5: pack to file (bitmap) 28.20(27.87+8.70) 5310.6: rev-list (commits) 0.41(0.36+0.05) 5310.7: rev-list (objects) 1.61(1.54+0.07) 5310.8: rev-list count with blob:none 0.25(0.21+0.04) 5310.9: rev-list count with blob:limit=1k 2.65(2.54+0.10) 5310.10: rev-list count with tree:0 0.23(0.19+0.04) 5310.11: simulated partial clone 4.34(4.21+0.12) 5310.13: clone (partial bitmap) 11.05(12.21+0.48) 5310.14: pack to file (partial bitmap) 31.25(34.22+3.70) 5310.15: rev-list with tree filter (partial bitmap) 0.26(0.22+0.04) versus the same tests (this time using a multi-pack index): Test HEAD ------------------------------------------------------------------------ 5326.2: setup multi-pack index 78.99(75.29+11.58) 5326.3: simulated clone 11.78(11.56+0.22) 5326.4: simulated fetch 1.70(4.49+0.13) 5326.5: pack to file (bitmap) 28.02(27.72+8.76) 5326.6: rev-list (commits) 0.42(0.36+0.06) 5326.7: rev-list (objects) 1.65(1.58+0.06) 5326.8: rev-list count with blob:none 0.26(0.21+0.05) 5326.9: rev-list count with blob:limit=1k 2.97(2.86+0.10) 5326.10: rev-list count with tree:0 0.25(0.20+0.04) 5326.11: simulated partial clone 5.65(5.49+0.16) 5326.13: clone (partial bitmap) 12.22(13.43+0.38) 5326.14: pack to file (partial bitmap) 30.05(31.57+7.25) 5326.15: rev-list with tree filter (partial bitmap) 0.24(0.20+0.04) There is slight overhead in "simulated clone", "simulated partial clone", and "clone (partial bitmap)". Unsurprisingly, that overhead is due to using the MIDX's reverse index to map between bit positions and MIDX positions. This can be reproduced by running "git repack -adb" along with "git multi-pack-index write --bitmap" in a large-ish repository. Then run: $ perf record -o pack.perf git -c core.multiPackIndex=false \ pack-objects --all --stdout >/dev/null </dev/null $ perf record -o midx.perf git -c core.multiPackIndex=true \ pack-objects --all --stdout >/dev/null </dev/null and compare the two with "perf diff -c delta -o 1 pack.perf midx.perf". The most notable results are below (the next largest positive delta is +0.14%): # Event 'cycles' # # Baseline Delta Shared Object Symbol # ........ ....... .................. .......................... # +5.86% git [.] nth_midxed_offset +5.24% git [.] nth_midxed_pack_int_id 3.45% +0.97% git [.] offset_to_pack_pos 3.30% +0.57% git [.] pack_pos_to_offset +0.30% git [.] pack_pos_to_midx Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9387fbd commit 2d59597

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

t/perf/p5326-multi-pack-bitmaps.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
3+
test_description='Tests performance using midx bitmaps'
4+
. ./perf-lib.sh
5+
. "${TEST_DIRECTORY}/perf/lib-bitmap.sh"
6+
7+
test_perf_large_repo
8+
9+
test_expect_success 'enable multi-pack index' '
10+
git config core.multiPackIndex true
11+
'
12+
13+
test_perf 'setup multi-pack index' '
14+
git repack -ad &&
15+
git multi-pack-index write --bitmap
16+
'
17+
18+
test_full_bitmap
19+
20+
test_expect_success 'create partial bitmap state' '
21+
# pick a commit to represent the repo tip in the past
22+
cutoff=$(git rev-list HEAD~100 -1) &&
23+
orig_tip=$(git rev-parse HEAD) &&
24+
25+
# now pretend we have just one tip
26+
rm -rf .git/logs .git/refs/* .git/packed-refs &&
27+
git update-ref HEAD $cutoff &&
28+
29+
# and then repack, which will leave us with a nice
30+
# big bitmap pack of the "old" history, and all of
31+
# the new history will be loose, as if it had been pushed
32+
# up incrementally and exploded via unpack-objects
33+
git repack -Ad &&
34+
git multi-pack-index write --bitmap &&
35+
36+
# and now restore our original tip, as if the pushes
37+
# had happened
38+
git update-ref HEAD $orig_tip
39+
'
40+
41+
test_partial_bitmap
42+
43+
test_done

0 commit comments

Comments
 (0)