Merge branch 'mg/status-in-progress-info' into pu
[git] / t / perf / p5302-pack-index.sh
1 #!/bin/sh
2
3 test_description="Tests index-pack performance"
4
5 . ./perf-lib.sh
6
7 test_perf_large_repo
8
9 test_expect_success 'repack' '
10         git repack -ad &&
11         PACK=$(ls .git/objects/pack/*.pack | head -n1) &&
12         test -f "$PACK" &&
13         export PACK
14 '
15
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
23 test_perf 'index-pack 0 threads' '
24         GIT_DIR=t1 git index-pack --threads=1 --stdin < $PACK
25 '
26
27 test_perf 'index-pack 1 thread ' '
28         GIT_DIR=t2 GIT_FORCE_THREADS=1 git index-pack --threads=1 --stdin < $PACK
29 '
30
31 test_perf 'index-pack 2 threads' '
32         GIT_DIR=t3 git index-pack --threads=2 --stdin < $PACK
33 '
34
35 test_perf 'index-pack 4 threads' '
36         GIT_DIR=t4 git index-pack --threads=4 --stdin < $PACK
37 '
38
39 test_perf 'index-pack 8 threads' '
40         GIT_DIR=t5 git index-pack --threads=8 --stdin < $PACK
41 '
42
43 test_perf 'index-pack default number of threads' '
44         GIT_DIR=t6 git index-pack --stdin < $PACK
45 '
46
47 test_done