99bdb16c8583a98b0c33cddadabb85f47b7d5c41
1#!/bin/sh
2
3test_description="Tests index-pack performance"
4
5. ./perf-lib.sh
6
7test_perf_large_repo
8
9test_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
16test_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
23test_perf 'index-pack 0 threads' '
24 GIT_DIR=t1 git index-pack --threads=1 --stdin < $PACK
25'
26
27test_perf 'index-pack 1 thread ' '
28 GIT_DIR=t2 GIT_FORCE_THREADS=1 git index-pack --threads=1 --stdin < $PACK
29'
30
31test_perf 'index-pack 2 threads' '
32 GIT_DIR=t3 git index-pack --threads=2 --stdin < $PACK
33'
34
35test_perf 'index-pack 4 threads' '
36 GIT_DIR=t4 git index-pack --threads=4 --stdin < $PACK
37'
38
39test_perf 'index-pack 8 threads' '
40 GIT_DIR=t5 git index-pack --threads=8 --stdin < $PACK
41'
42
43test_perf 'index-pack default number of threads' '
44 GIT_DIR=t6 git index-pack --stdin < $PACK
45'
46
47test_done