]> git.ipfire.org Git - thirdparty/git.git/blame - t/perf/p5310-pack-bitmaps.sh
Merge branch 'ea/blame-use-oideq'
[thirdparty/git.git] / t / perf / p5310-pack-bitmaps.sh
CommitLineData
bbcefa1f
JK
1#!/bin/sh
2
3test_description='Tests pack performance using bitmaps'
4. ./perf-lib.sh
5
6test_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 14test_expect_success 'setup bitmap config' '
d4316604 15 git config pack.writebitmaps true
bbcefa1f
JK
16'
17
18test_perf 'repack to disk' '
19 git repack -ad
20'
21
22test_perf 'simulated clone' '
23 git pack-objects --stdout --all </dev/null >/dev/null
24'
25
26test_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
34test_perf 'pack to file (bitmap)' '
35 git pack-objects --use-bitmap-index --all pack1b </dev/null >/dev/null
36'
37
4eb707eb
JK
38test_perf 'rev-list (commits)' '
39 git rev-list --all --use-bitmap-index >/dev/null
40'
41
42test_perf 'rev-list (objects)' '
43 git rev-list --all --use-bitmap-index --objects >/dev/null
44'
45
4f3bd560
JK
46test_perf 'rev-list count with blob:none' '
47 git rev-list --use-bitmap-index --count --objects --all \
48 --filter=blob:none >/dev/null
49'
50
84243da1
JK
51test_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
b0a8d482
TB
54'
55
56test_perf 'rev-list count with tree:0' '
57 git rev-list --use-bitmap-index --count --objects --all \
58 --filter=tree:0 >/dev/null
84243da1
JK
59'
60
3ab3185f
JK
61test_perf 'simulated partial clone' '
62 git pack-objects --stdout --all --filter=blob:none </dev/null >/dev/null
63'
64
bbcefa1f
JK
65test_expect_success 'create partial bitmap state' '
66 # pick a commit to represent the repo tip in the past
67 cutoff=$(git rev-list HEAD~100 -1) &&
68 orig_tip=$(git rev-parse HEAD) &&
69
70 # now kill off all of the refs and pretend we had
71 # just the one tip
5330e6e2
SB
72 rm -rf .git/logs .git/refs/* .git/packed-refs &&
73 git update-ref HEAD $cutoff &&
bbcefa1f
JK
74
75 # and then repack, which will leave us with a nice
76 # big bitmap pack of the "old" history, and all of
77 # the new history will be loose, as if it had been pushed
78 # up incrementally and exploded via unpack-objects
5330e6e2 79 git repack -Ad &&
bbcefa1f
JK
80
81 # and now restore our original tip, as if the pushes
82 # had happened
83 git update-ref HEAD $orig_tip
84'
85
645c432d 86test_perf 'clone (partial bitmap)' '
bbcefa1f
JK
87 git pack-objects --stdout --all </dev/null >/dev/null
88'
89
645c432d
KS
90test_perf 'pack to file (partial bitmap)' '
91 git pack-objects --use-bitmap-index --all pack2b </dev/null >/dev/null
92'
93
9639474b
JK
94test_perf 'rev-list with tree filter (partial bitmap)' '
95 git rev-list --use-bitmap-index --count --objects --all \
96 --filter=tree:0 >/dev/null
97'
98
bbcefa1f 99test_done