builtin: patch-id: add --verbatim as a command mode
[git/debian.git] / t / perf / p4209-pickaxe.sh
blobf585a4465aebf4e7d2006687304332069fccef6c
1 #!/bin/sh
3 test_description="Test pickaxe performance"
5 . ./perf-lib.sh
7 test_perf_default_repo
9 # Not --max-count, as that's the number of matching commit, so it's
10 # unbounded. We want to limit our revision walk here.
11 from_rev_desc=
12 from_rev=
13 max_count=1000
14 if test_have_prereq EXPENSIVE
15 then
16 max_count=10000
18 from_rev=" $(git rev-list HEAD | head -n $max_count | tail -n 1).."
19 from_rev_desc=" <limit-rev>.."
21 for icase in \
22 '' \
23 '-i '
25 # -S (no regex)
26 for pattern in \
27 'int main' \
28 'æ'
30 for opts in \
31 '-S'
33 test_perf "git log $icase$opts'$pattern'$from_rev_desc" "
34 git log --pretty=format:%H $icase$opts'$pattern'$from_rev
36 done
37 done
39 # -S (regex)
40 for pattern in \
41 '(int|void|null)' \
42 'if *\([^ ]+ & ' \
43 '[àáâãäåæñøùúûüýþ]'
45 for opts in \
46 '--pickaxe-regex -S'
48 test_perf "git log $icase$opts'$pattern'$from_rev_desc" "
49 git log --pretty=format:%H $icase$opts'$pattern'$from_rev
51 done
52 done
54 # -G
55 for pattern in \
56 '(int|void|null)' \
57 'if *\([^ ]+ & ' \
58 '[àáâãäåæñøùúûüýþ]'
60 for opts in \
61 '-G'
63 test_perf "git log $icase$opts'$pattern'$from_rev_desc" "
64 git log --pretty=format:%H $icase$opts'$pattern'$from_rev
66 done
67 done
68 done
70 test_done