1#!/bin/sh
23
test_description="Tests index-pack performance"
45
. ./perf-lib.sh
67
test_perf_large_repo
89
test_expect_success 'repack' '
10git repack -ad &&
11PACK=$(ls .git/objects/pack/*.pack | head -n1) &&
12test -f "$PACK" &&
13export PACK
14'
1516
test_expect_success 'create target repositories' '
17for repo in t1 t2 t3 t4 t5 t6
18do
19git init --bare $repo
20done
21'
2223
test_perf 'index-pack 0 threads' '
24GIT_DIR=t1 git index-pack --threads=1 --stdin < $PACK
25'
2627
test_perf 'index-pack 1 thread ' '
28GIT_DIR=t2 GIT_FORCE_THREADS=1 git index-pack --threads=1 --stdin < $PACK
29'
3031
test_perf 'index-pack 2 threads' '
32GIT_DIR=t3 git index-pack --threads=2 --stdin < $PACK
33'
3435
test_perf 'index-pack 4 threads' '
36GIT_DIR=t4 git index-pack --threads=4 --stdin < $PACK
37'
3839
test_perf 'index-pack 8 threads' '
40GIT_DIR=t5 git index-pack --threads=8 --stdin < $PACK
41'
4243
test_perf 'index-pack default number of threads' '
44GIT_DIR=t6 git index-pack --stdin < $PACK
45'
4647
test_done