Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/perf/p5302-pack-index.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / perf / p5302-pack-index.sh` 50 lines ยท 1229 bytes Raw Blame History 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 # Rather than counting up and doubling each time, count down from the endpoint, 17 # halving each time. That ensures that our final test uses as many threads as 18 # CPUs, even if it isn't a power of 2. 19 test_expect_success 'set up thread-counting tests' ' 20 t=$(test-tool online-cpus) && 21 threads= && 22 while test $t -gt 0 23 do 24 threads="$t $threads" && 25 t=$((t / 2)) || return 1 26 done 27 ' 28 29 test_perf 'index-pack 0 threads' --prereq PERF_EXTRA \ 30 --setup 'rm -rf repo.git && git init --bare repo.git' ' 31 GIT_DIR=repo.git git index-pack --threads=1 --stdin < $PACK 32 ' 33 34 for t in $threads 35 do 36 THREADS=$t 37 export THREADS 38 test_perf "index-pack $t threads" --prereq PERF_EXTRA \ 39 --setup 'rm -rf repo.git && git init --bare repo.git' ' 40 GIT_DIR=repo.git GIT_FORCE_THREADS=1 \ 41 git index-pack --threads=$THREADS --stdin <$PACK 42 ' 43 done 44 45 test_perf 'index-pack default number of threads' \ 46 --setup 'rm -rf repo.git && git init --bare repo.git' ' 47 GIT_DIR=repo.git git index-pack --stdin < $PACK 48 ' 49 50 test_done