Merge branch 'ob/sequencer-rearrange-cleanup'
[git.git] / t / perf / p1500-graph-walks.sh
blobe14e7620cce38362c5233fd50bfbe38690a4cd64
1 #!/bin/sh
3 test_description='Commit walk performance tests'
4 . ./perf-lib.sh
6 test_perf_large_repo
8 test_expect_success 'setup' '
9 git for-each-ref --format="%(refname)" "refs/heads/*" "refs/tags/*" >allrefs &&
10 sort -r allrefs | head -n 50 >refs &&
11 for ref in $(cat refs)
13 git branch -f ref-$ref $ref &&
14 echo ref-$ref ||
15 return 1
16 done >branches &&
17 for ref in $(cat refs)
19 git tag -f tag-$ref $ref &&
20 echo tag-$ref ||
21 return 1
22 done >tags &&
23 git commit-graph write --reachable
26 test_perf 'ahead-behind counts: git for-each-ref' '
27 git for-each-ref --format="%(ahead-behind:HEAD)" --stdin <refs
30 test_perf 'ahead-behind counts: git branch' '
31 xargs git branch -l --format="%(ahead-behind:HEAD)" <branches
34 test_perf 'ahead-behind counts: git tag' '
35 xargs git tag -l --format="%(ahead-behind:HEAD)" <tags
38 test_perf 'contains: git for-each-ref --merged' '
39 git for-each-ref --merged=HEAD --stdin <refs
42 test_perf 'contains: git branch --merged' '
43 xargs git branch --merged=HEAD <branches
46 test_perf 'contains: git tag --merged' '
47 xargs git tag --merged=HEAD <tags
50 test_done