@@ -6,13 +6,21 @@ Set GIT_PERF_7821_GREP_OPTS in the environment to pass options to
6
6
git-grep. Make sure to include a leading space,
7
7
e.g. GIT_PERF_7821_GREP_OPTS=' -w'. See p7820-grep-engines.sh for more
8
8
options to try.
9
+
10
+ If GIT_PERF_7821_THREADS is set to a list of threads (e.g. '1 4 8'
11
+ etc.) we will test the patterns under those numbers of threads.
9
12
"
10
13
11
14
. ./perf-lib.sh
12
15
13
16
test_perf_large_repo
14
17
test_checkout_worktree
15
18
19
+ if test -n " $GIT_PERF_GREP_THREADS "
20
+ then
21
+ test_set_prereq PERF_GREP_ENGINES_THREADS
22
+ fi
23
+
16
24
for pattern in ' int' ' uncommon' ' æ'
17
25
do
18
26
for engine in fixed basic extended perl
23
31
else
24
32
prereq=" "
25
33
fi
26
- test_perf $prereq " $engine grep$GIT_PERF_7821_GREP_OPTS $pattern " "
27
- git -c grep.patternType=$engine grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine ' || :
28
- "
29
- done
30
-
31
- test_expect_success " assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern " '
32
- test_cmp out.fixed out.basic &&
33
- test_cmp out.fixed out.extended &&
34
- if test_have_prereq PCRE
34
+ if ! test_have_prereq PERF_GREP_ENGINES_THREADS
35
35
then
36
- test_cmp out.fixed out.perl
36
+ test_perf $prereq " $engine grep$GIT_PERF_7821_GREP_OPTS $pattern " "
37
+ git -c grep.patternType=$engine grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine ' || :
38
+ "
39
+ else
40
+ for threads in $GIT_PERF_GREP_THREADS
41
+ do
42
+ test_perf PTHREADS,$prereq " $engine grep$GIT_PERF_7821_GREP_OPTS $pattern with $threads threads" "
43
+ git -c grep.patternType=$engine -c grep.threads=$threads grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine .$threads ' || :
44
+ "
45
+ done
37
46
fi
38
- '
47
+ done
48
+
49
+ if ! test_have_prereq PERF_GREP_ENGINES_THREADS
50
+ then
51
+ test_expect_success " assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern " '
52
+ test_cmp out.fixed out.basic &&
53
+ test_cmp out.fixed out.extended &&
54
+ if test_have_prereq PCRE
55
+ then
56
+ test_cmp out.fixed out.perl
57
+ fi
58
+ '
59
+ else
60
+ for threads in $GIT_PERF_GREP_THREADS
61
+ do
62
+ test_expect_success PTHREADS " assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern under threading" "
63
+ test_cmp out.fixed.$threads out.basic.$threads &&
64
+ test_cmp out.fixed.$threads out.extended.$threads &&
65
+ if test_have_prereq PCRE
66
+ then
67
+ test_cmp out.fixed.$threads out.perl.$threads
68
+ fi
69
+ "
70
+ done
71
+ fi
39
72
done
40
73
41
74
test_done
0 commit comments