Merge branch 'pe/time-use-gettimeofday'
[git.git] / t / perf / p5311-pack-bitmaps-fetch.sh
blob426fab87e3293e0d1817159eacd1f63e6cd27fd7
1 #!/bin/sh
3 test_description='performance of fetches from bitmapped packs'
4 . ./perf-lib.sh
6 test_fetch_bitmaps () {
7 test_expect_success 'setup test directory' '
8 rm -fr * .git
11 test_perf_default_repo
13 test_expect_success 'create bitmapped server repo' '
14 git config pack.writebitmaps true &&
15 git config pack.writeBitmapLookupTable '"$1"' &&
16 git repack -ad
19 # simulate a fetch from a repository that last fetched N days ago, for
20 # various values of N. We do so by following the first-parent chain,
21 # and assume the first entry in the chain that is N days older than the current
22 # HEAD is where the HEAD would have been then.
23 for days in 1 2 4 8 16 32 64 128; do
24 title=$(printf '%10s' "($days days)")
25 test_expect_success "setup revs from $days days ago" '
26 now=$(git log -1 --format=%ct HEAD) &&
27 then=$(($now - ($days * 86400))) &&
28 tip=$(git rev-list -1 --first-parent --until=$then HEAD) &&
30 echo HEAD &&
31 echo ^$tip
32 } >revs
35 test_perf "server $title (lookup=$1)" '
36 git pack-objects --stdout --revs \
37 --thin --delta-base-offset \
38 <revs >tmp.pack
41 test_size "size $title" '
42 wc -c <tmp.pack
45 test_perf "client $title (lookup=$1)" '
46 git index-pack --stdin --fix-thin <tmp.pack
48 done
51 test_fetch_bitmaps true
52 test_fetch_bitmaps false
54 test_done