]>
Commit | Line | Data |
---|---|---|
bbcefa1f JK |
1 | #!/bin/sh |
2 | ||
3 | test_description='Tests pack performance using bitmaps' | |
4 | . ./perf-lib.sh | |
5 | ||
6 | test_perf_large_repo | |
7 | ||
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 | |
71d76cb4 JK |
11 | # |
12 | # We intentionally use the deprecated pack.writebitmaps | |
13 | # config so that we can test against older versions of git. | |
bbcefa1f | 14 | test_expect_success 'setup bitmap config' ' |
d4316604 | 15 | git config pack.writebitmaps true |
bbcefa1f JK |
16 | ' |
17 | ||
18 | test_perf 'repack to disk' ' | |
19 | git repack -ad | |
20 | ' | |
21 | ||
22 | test_perf 'simulated clone' ' | |
23 | git pack-objects --stdout --all </dev/null >/dev/null | |
24 | ' | |
25 | ||
26 | test_perf 'simulated fetch' ' | |
27 | have=$(git rev-list HEAD~100 -1) && | |
28 | { | |
29 | echo HEAD && | |
30 | echo ^$have | |
31 | } | git pack-objects --revs --stdout >/dev/null | |
32 | ' | |
33 | ||
645c432d KS |
34 | test_perf 'pack to file' ' |
35 | git pack-objects --all pack1 </dev/null >/dev/null | |
36 | ' | |
37 | ||
38 | test_perf 'pack to file (bitmap)' ' | |
39 | git pack-objects --use-bitmap-index --all pack1b </dev/null >/dev/null | |
40 | ' | |
41 | ||
4eb707eb JK |
42 | test_perf 'rev-list (commits)' ' |
43 | git rev-list --all --use-bitmap-index >/dev/null | |
44 | ' | |
45 | ||
46 | test_perf 'rev-list (objects)' ' | |
47 | git rev-list --all --use-bitmap-index --objects >/dev/null | |
48 | ' | |
49 | ||
4f3bd560 JK |
50 | test_perf 'rev-list count with blob:none' ' |
51 | git rev-list --use-bitmap-index --count --objects --all \ | |
52 | --filter=blob:none >/dev/null | |
53 | ' | |
54 | ||
84243da1 JK |
55 | test_perf 'rev-list count with blob:limit=1k' ' |
56 | git rev-list --use-bitmap-index --count --objects --all \ | |
57 | --filter=blob:limit=1k >/dev/null | |
58 | ' | |
59 | ||
3ab3185f JK |
60 | test_perf 'simulated partial clone' ' |
61 | git pack-objects --stdout --all --filter=blob:none </dev/null >/dev/null | |
62 | ' | |
63 | ||
bbcefa1f JK |
64 | test_expect_success 'create partial bitmap state' ' |
65 | # pick a commit to represent the repo tip in the past | |
66 | cutoff=$(git rev-list HEAD~100 -1) && | |
67 | orig_tip=$(git rev-parse HEAD) && | |
68 | ||
69 | # now kill off all of the refs and pretend we had | |
70 | # just the one tip | |
5330e6e2 SB |
71 | rm -rf .git/logs .git/refs/* .git/packed-refs && |
72 | git update-ref HEAD $cutoff && | |
bbcefa1f JK |
73 | |
74 | # and then repack, which will leave us with a nice | |
75 | # big bitmap pack of the "old" history, and all of | |
76 | # the new history will be loose, as if it had been pushed | |
77 | # up incrementally and exploded via unpack-objects | |
5330e6e2 | 78 | git repack -Ad && |
bbcefa1f JK |
79 | |
80 | # and now restore our original tip, as if the pushes | |
81 | # had happened | |
82 | git update-ref HEAD $orig_tip | |
83 | ' | |
84 | ||
645c432d | 85 | test_perf 'clone (partial bitmap)' ' |
bbcefa1f JK |
86 | git pack-objects --stdout --all </dev/null >/dev/null |
87 | ' | |
88 | ||
645c432d KS |
89 | test_perf 'pack to file (partial bitmap)' ' |
90 | git pack-objects --use-bitmap-index --all pack2b </dev/null >/dev/null | |
91 | ' | |
92 | ||
bbcefa1f | 93 | test_done |