3 test_description='Tests pack performance using bitmaps'
8 # note that we do everything through config,
9 # since we want to be able to compare bitmap-aware
10 # git versus non-bitmap git
12 # We intentionally use the deprecated pack.writebitmaps
13 # config so that we can test against older versions of git.
14 test_expect_success 'setup bitmap config' '
15 git config pack.writebitmaps true
18 test_perf 'repack to disk' '
22 test_perf 'simulated clone' '
23 git pack-objects --stdout --all </dev/null >/dev/null
26 test_perf 'simulated fetch' '
27 have=$(git rev-list HEAD~100 -1) &&
31 } | git pack-objects --revs --stdout >/dev/null
34 test_perf 'pack to file (bitmap)' '
35 git pack-objects --use-bitmap-index --all pack1b </dev/null >/dev/null
38 test_perf 'rev-list (commits)' '
39 git rev-list --all --use-bitmap-index >/dev/null
42 test_perf 'rev-list (objects)' '
43 git rev-list --all --use-bitmap-index --objects >/dev/null
46 test_perf 'rev-list count with blob:none' '
47 git rev-list --use-bitmap-index --count --objects --all \
48 --filter=blob:none >/dev/null
51 test_perf 'rev-list count with blob:limit=1k' '
52 git rev-list --use-bitmap-index --count --objects --all \
53 --filter=blob:limit=1k >/dev/null
56 test_perf 'simulated partial clone' '
57 git pack-objects --stdout --all --filter=blob:none </dev/null >/dev/null
60 test_expect_success 'create partial bitmap state' '
61 # pick a commit to represent the repo tip in the past
62 cutoff=$(git rev-list HEAD~100 -1) &&
63 orig_tip=$(git rev-parse HEAD) &&
65 # now kill off all of the refs and pretend we had
67 rm -rf .git/logs .git/refs/* .git/packed-refs &&
68 git update-ref HEAD $cutoff &&
70 # and then repack, which will leave us with a nice
71 # big bitmap pack of the "old" history, and all of
72 # the new history will be loose, as if it had been pushed
73 # up incrementally and exploded via unpack-objects
76 # and now restore our original tip, as if the pushes
78 git update-ref HEAD $orig_tip
81 test_perf 'clone (partial bitmap)' '
82 git pack-objects --stdout --all </dev/null >/dev/null
85 test_perf 'pack to file (partial bitmap)' '
86 git pack-objects --use-bitmap-index --all pack2b </dev/null >/dev/null