Skip to content

Commit 01e0d54

Browse files
rscharfegitster
authored andcommitted
fsck: add a performance test for skipList
Create a performance test to see how the skipList implementation performs. First we setup N bad commits, then we see how progressively working our way up to 0..N in increments of 10x does. I.e. the needle(s) in the haystack get progressively more numerous. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6cb173b commit 01e0d54

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

t/perf/p1451-fsck-skip-list.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
3+
test_description='Test fsck skipList performance'
4+
5+
. ./perf-lib.sh
6+
7+
test_perf_fresh_repo
8+
9+
n=1000000
10+
11+
test_expect_success "setup $n bad commits" '
12+
for i in $(test_seq 1 $n)
13+
do
14+
echo "commit refs/heads/master" &&
15+
echo "committer C <[email protected]> 1234567890 +0000" &&
16+
echo "data <<EOF" &&
17+
echo "$i.Q." &&
18+
echo "EOF"
19+
done | q_to_nul | git fast-import
20+
'
21+
22+
skip=0
23+
while test $skip -le $n
24+
do
25+
test_expect_success "create skipList for $skip bad commits" '
26+
git log --format=%H --max-count=$skip |
27+
sort >skiplist
28+
'
29+
30+
test_perf "fsck with $skip skipped bad commits" '
31+
git -c fsck.skipList=skiplist fsck
32+
'
33+
34+
case $skip in
35+
0) skip=1 ;;
36+
*) skip=${skip}0 ;;
37+
esac
38+
done
39+
40+
test_done

0 commit comments

Comments
 (0)