Skip to content

Commit e7a1b38

Browse files
committed
Merge branch 'jk/p5302-avoid-collision-check-cost'
Fix index-pack perf test so that the repeated invocations always run in an empty repository, which emulates the initial clone situation better. * jk/p5302-avoid-collision-check-cost: p5302: create the repo in each index-pack test
2 parents 4aeeef3 + 775c71e commit e7a1b38

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

t/perf/p5302-pack-index.sh

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,40 @@ test_expect_success 'repack' '
1313
export PACK
1414
'
1515

16-
test_expect_success 'create target repositories' '
17-
for repo in t1 t2 t3 t4 t5 t6
18-
do
19-
git init --bare $repo
20-
done
21-
'
22-
2316
test_perf 'index-pack 0 threads' '
24-
GIT_DIR=t1 git index-pack --threads=1 --stdin < $PACK
17+
rm -rf repo.git &&
18+
git init --bare repo.git &&
19+
GIT_DIR=repo.git git index-pack --threads=1 --stdin < $PACK
2520
'
2621

2722
test_perf 'index-pack 1 thread ' '
28-
GIT_DIR=t2 GIT_FORCE_THREADS=1 git index-pack --threads=1 --stdin < $PACK
23+
rm -rf repo.git &&
24+
git init --bare repo.git &&
25+
GIT_DIR=repo.git GIT_FORCE_THREADS=1 git index-pack --threads=1 --stdin < $PACK
2926
'
3027

3128
test_perf 'index-pack 2 threads' '
32-
GIT_DIR=t3 git index-pack --threads=2 --stdin < $PACK
29+
rm -rf repo.git &&
30+
git init --bare repo.git &&
31+
GIT_DIR=repo.git git index-pack --threads=2 --stdin < $PACK
3332
'
3433

3534
test_perf 'index-pack 4 threads' '
36-
GIT_DIR=t4 git index-pack --threads=4 --stdin < $PACK
35+
rm -rf repo.git &&
36+
git init --bare repo.git &&
37+
GIT_DIR=repo.git git index-pack --threads=4 --stdin < $PACK
3738
'
3839

3940
test_perf 'index-pack 8 threads' '
40-
GIT_DIR=t5 git index-pack --threads=8 --stdin < $PACK
41+
rm -rf repo.git &&
42+
git init --bare repo.git &&
43+
GIT_DIR=repo.git git index-pack --threads=8 --stdin < $PACK
4144
'
4245

4346
test_perf 'index-pack default number of threads' '
44-
GIT_DIR=t6 git index-pack --stdin < $PACK
47+
rm -rf repo.git &&
48+
git init --bare repo.git &&
49+
GIT_DIR=repo.git git index-pack --stdin < $PACK
4550
'
4651

4752
test_done

0 commit comments

Comments
 (0)