2012-05-06 12:31:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description="Tests index-pack performance"
|
|
|
|
|
|
|
|
. ./perf-lib.sh
|
|
|
|
|
|
|
|
test_perf_large_repo
|
|
|
|
|
|
|
|
test_expect_success 'repack' '
|
|
|
|
git repack -ad &&
|
2014-04-23 13:44:06 +00:00
|
|
|
PACK=$(ls .git/objects/pack/*.pack | head -n1) &&
|
2012-05-06 12:31:55 +00:00
|
|
|
test -f "$PACK" &&
|
|
|
|
export PACK
|
|
|
|
'
|
|
|
|
|
|
|
|
test_perf 'index-pack 0 threads' '
|
2019-04-22 21:19:52 +00:00
|
|
|
rm -rf repo.git &&
|
|
|
|
git init --bare repo.git &&
|
|
|
|
GIT_DIR=repo.git git index-pack --threads=1 --stdin < $PACK
|
2012-05-06 12:31:55 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_perf 'index-pack 1 thread ' '
|
2019-04-22 21:19:52 +00:00
|
|
|
rm -rf repo.git &&
|
|
|
|
git init --bare repo.git &&
|
|
|
|
GIT_DIR=repo.git GIT_FORCE_THREADS=1 git index-pack --threads=1 --stdin < $PACK
|
2012-05-06 12:31:55 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_perf 'index-pack 2 threads' '
|
2019-04-22 21:19:52 +00:00
|
|
|
rm -rf repo.git &&
|
|
|
|
git init --bare repo.git &&
|
|
|
|
GIT_DIR=repo.git git index-pack --threads=2 --stdin < $PACK
|
2012-05-06 12:31:55 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_perf 'index-pack 4 threads' '
|
2019-04-22 21:19:52 +00:00
|
|
|
rm -rf repo.git &&
|
|
|
|
git init --bare repo.git &&
|
|
|
|
GIT_DIR=repo.git git index-pack --threads=4 --stdin < $PACK
|
2012-05-06 12:31:55 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_perf 'index-pack 8 threads' '
|
2019-04-22 21:19:52 +00:00
|
|
|
rm -rf repo.git &&
|
|
|
|
git init --bare repo.git &&
|
|
|
|
GIT_DIR=repo.git git index-pack --threads=8 --stdin < $PACK
|
2012-05-06 12:31:55 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_perf 'index-pack default number of threads' '
|
2019-04-22 21:19:52 +00:00
|
|
|
rm -rf repo.git &&
|
|
|
|
git init --bare repo.git &&
|
|
|
|
GIT_DIR=repo.git git index-pack --stdin < $PACK
|
2012-05-06 12:31:55 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|