The sixth batch
[git/gitster.git] / t / perf / p0100-globbing.sh
blob439e9c8e3c6484fe3a6f34a4f5903b07397d0c1f
1 #!/bin/sh
3 test_description="Tests pathological globbing performance
5 Shows how Git's globbing performance performs when given the sort of
6 pathological patterns described in at https://research.swtch.com/glob
9 . ./perf-lib.sh
11 test_globs_big='10 25 50 75 100'
12 test_globs_small='1 2 3 4 5 6'
14 test_perf_fresh_repo
16 test_expect_success 'setup' '
17 for i in $(test_seq 1 100)
19 printf "a" >>refname &&
20 for j in $(test_seq 1 $i)
22 printf "a*" >>refglob.$i || return 1
23 done &&
24 echo b >>refglob.$i || return 1
25 done &&
26 test_commit test $(cat refname).t "" $(cat refname).t
29 for i in $test_globs_small
31 test_perf "refglob((a*)^nb) against tag (a^100).t; n = $i" '
32 git for-each-ref "refs/tags/$(cat refglob.'$i')b"
34 done
36 for i in $test_globs_small
38 test_perf "fileglob((a*)^nb) against file (a^100).t; n = $i" '
39 git ls-files "$(cat refglob.'$i')b"
41 done
43 test_done