git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/5] perf: grep: avoid unused prereq

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Mar 12, 2023, 20:08 UTC
Message-ID
<20230312200856.323688-5-felipe.contreras@gmail.com>
In-Reply-To
<20230312200856.323688-1-felipe.contreras@gmail.com>

There is no point in setting PERF_GREP_ENGINES_THREADS if we are going to check it ourselves.

Cc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/perf/p7820-grep-engines.sh        | 9 ++-------
 t/perf/p7821-grep-engines-fixed.sh  | 9 ++-------
 t/perf/p7822-grep-perl-character.sh | 7 +------
 3 files changed, 5 insertions(+), 20 deletions(-)
diff --git a/t/perf/p7820-grep-engines.sh b/t/perf/p7820-grep-engines.sh
index 336424cb00..f80fdcb5e2 100755
--- a/t/perf/p7820-grep-engines.sh
+++ b/t/perf/p7820-grep-engines.sh
@@ -22,11 +22,6 @@ etc.) we will test the patterns under those numbers of threads.
 test_perf_large_repo
 test_checkout_worktree
 
-if test -n "$GIT_PERF_GREP_THREADS"
-then
-	test_set_prereq PERF_GREP_ENGINES_THREADS
-fi
-
 for pattern in \
 	'how.to' \
 	'^how to' \
@@ -47,7 +42,7 @@ do
 		else
 			prereq=""
 		fi
-		if ! test_have_prereq PERF_GREP_ENGINES_THREADS
+		if test -z "$GIT_PERF_GREP_THREADS"
 		then
 			test_perf "$engine grep$GIT_PERF_7820_GREP_OPTS '$pattern'" \
 				--prereq "$prereq" "
@@ -64,7 +59,7 @@ do
 		fi
 	done
 
-	if ! test_have_prereq PERF_GREP_ENGINES_THREADS
+	if test -z "$GIT_PERF_GREP_THREADS"
 	then
 		test_expect_success "assert that all engines found the same for$GIT_PERF_7820_GREP_OPTS '$pattern'" '
 			test_cmp out.basic out.extended &&
diff --git a/t/perf/p7821-grep-engines-fixed.sh b/t/perf/p7821-grep-engines-fixed.sh
index 79b1b9f8b2..f25b4976ea 100755
--- a/t/perf/p7821-grep-engines-fixed.sh
+++ b/t/perf/p7821-grep-engines-fixed.sh
@@ -16,11 +16,6 @@ etc.) we will test the patterns under those numbers of threads.
 test_perf_large_repo
 test_checkout_worktree
 
-if test -n "$GIT_PERF_GREP_THREADS"
-then
-	test_set_prereq PERF_GREP_ENGINES_THREADS
-fi
-
 for pattern in 'int' 'uncommon' 'æ'
 do
 	for engine in fixed basic extended perl
@@ -31,7 +26,7 @@ do
 		else
 			prereq=""
 		fi
-		if ! test_have_prereq PERF_GREP_ENGINES_THREADS
+		if test -z "$GIT_PERF_GREP_THREADS"
 		then
 			test_perf "$engine grep$GIT_PERF_7821_GREP_OPTS $pattern" --prereq "$prereq" "
 				git -c grep.patternType=$engine grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine' || :
@@ -46,7 +41,7 @@ do
 		fi
 	done
 
-	if ! test_have_prereq PERF_GREP_ENGINES_THREADS
+	if test -z "$GIT_PERF_GREP_THREADS"
 	then
 		test_expect_success "assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern" '
 			test_cmp out.fixed out.basic &&
diff --git a/t/perf/p7822-grep-perl-character.sh b/t/perf/p7822-grep-perl-character.sh
index 87009c60df..2b73d41e2b 100755
--- a/t/perf/p7822-grep-perl-character.sh
+++ b/t/perf/p7822-grep-perl-character.sh
@@ -11,11 +11,6 @@ etc.) we will test the patterns under those numbers of threads.
 test_perf_large_repo
 test_checkout_worktree
 
-if test -n "$GIT_PERF_GREP_THREADS"
-then
-	test_set_prereq PERF_GREP_ENGINES_THREADS
-fi
-
 for pattern in \
 	'\\bhow' \
 	'\\bÆvar' \
@@ -24,7 +19,7 @@ for pattern in \
 	'\\w{12}\\b'
 do
 	echo '$pattern' >pat
-	if ! test_have_prereq PERF_GREP_ENGINES_THREADS
+	if test -z "$GIT_PERF_GREP_THREADS"
 	then
 		test_perf "grep -P '$pattern'" --prereq PCRE "
 			git -P grep -f pat || :
-- 
2.39.2.13.g1fb56cf030
Previous: Felipe Contreras
Message 6 of 6 in “perf: fixes and cleanups”
  1. 0/5 perf: fixes and cleanupsFelipe Contreras, Mar 12, 2023
  2. 1/5 perf: sparse: remove grep --sparse optionFelipe Contreras, Mar 12, 2023
  3. 2/5 perf: grep: fix prereqsFelipe Contreras, Mar 12, 2023
  4. 3/5 perf: grep: don't check PRCE twiceFelipe Contreras, Mar 12, 2023
  5. 5/5 perf: aggregate: check if subtest existsFelipe Contreras, Mar 12, 2023
  6. 4/5 perf: grep: avoid unused prereqFelipe Contreras, Mar 12, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.