]> git.ipfire.org Git - thirdparty/git.git/blame - t/perf/p5311-pack-bitmaps-fetch.sh
Merge branch 'rs/bisect-start-leakfix' into maint-2.38
[thirdparty/git.git] / t / perf / p5311-pack-bitmaps-fetch.sh
CommitLineData
198b349d
JK
1#!/bin/sh
2
3test_description='performance of fetches from bitmapped packs'
4. ./perf-lib.sh
5
761416ef
AC
6test_fetch_bitmaps () {
7 test_expect_success 'setup test directory' '
8 rm -fr * .git
198b349d
JK
9 '
10
761416ef 11 test_perf_default_repo
198b349d 12
761416ef
AC
13 test_expect_success 'create bitmapped server repo' '
14 git config pack.writebitmaps true &&
15 git config pack.writeBitmapLookupTable '"$1"' &&
16 git repack -ad
198b349d
JK
17 '
18
761416ef
AC
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) &&
29 {
30 echo HEAD &&
31 echo ^$tip
32 } >revs
33 '
34
35 test_perf "server $title (lookup=$1)" '
36 git pack-objects --stdout --revs \
37 --thin --delta-base-offset \
38 <revs >tmp.pack
39 '
40
41 test_size "size $title" '
42 wc -c <tmp.pack
43 '
44
45 test_perf "client $title (lookup=$1)" '
46 git index-pack --stdin --fix-thin <tmp.pack
47 '
48 done
49}
50
51test_fetch_bitmaps true
52test_fetch_bitmaps false
198b349d
JK
53
54test_done