{"thread":{"id":"59380","subject":"[PATCH 0/5] perf: fixes and cleanups","startedAt":"2023-03-12T20:09:24Z","lastAt":"2023-03-12T20:09:41Z","messageCount":6,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"473419","messageId":"20230312200856.323688-1-felipe.contreras@gmail.com","threadId":"59380","inReplyTo":null,"subject":"[PATCH 0/5] perf: fixes and cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-03-12T20:08:51Z","receivedAt":"2023-03-12T20:09:24Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Just for the sake of it I tried to `make perf` for the first time and it\ndidn't work. What follows are some fixes and cleanups I found along the\nway.\n\nOne problem should have prevented this target to build since six months\nago, I'm surprised nobody has seen it. Maybe more people should try\n`GIT_PERF_REPEAT_COUNT=1 make perf` just to make sure it builds.\n\nFelipe Contreras (5):\n  perf: sparse: remove grep --sparse option\n  perf: grep: fix prereqs\n  perf: grep: don't check PRCE twice\n  perf: grep: avoid unused prereq\n  perf: aggregate: check if subtest exists\n\n t/perf/aggregate.perl                  |  1 +\n t/perf/p2000-sparse-operations.sh      |  2 +-\n t/perf/p4220-log-grep-engines.sh       |  2 +-\n t/perf/p4221-log-grep-engines-fixed.sh |  2 +-\n t/perf/p7820-grep-engines.sh           | 11 +++--------\n t/perf/p7821-grep-engines-fixed.sh     | 15 +++++----------\n t/perf/p7822-grep-perl-character.sh    |  7 +------\n 7 files changed, 13 insertions(+), 27 deletions(-)\n\n-- \n2.39.2.13.g1fb56cf030\n\n"},{"id":"473420","messageId":"20230312200856.323688-2-felipe.contreras@gmail.com","threadId":"59380","inReplyTo":"20230312200856.323688-1-felipe.contreras@gmail.com","subject":"[PATCH 1/5] perf: sparse: remove grep --sparse option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-03-12T20:08:52Z","receivedAt":"2023-03-12T20:09:30Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"It was never added.\n\nCc: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/perf/p2000-sparse-operations.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/perf/p2000-sparse-operations.sh b/t/perf/p2000-sparse-operations.sh\nindex 3242cfe91a..e4a132f593 100755\n--- a/t/perf/p2000-sparse-operations.sh\n+++ b/t/perf/p2000-sparse-operations.sh\n@@ -124,6 +124,6 @@ test_perf_on_all git read-tree -mu HEAD\n test_perf_on_all git checkout-index -f --all\n test_perf_on_all git update-index --add --remove $SPARSE_CONE/a\n test_perf_on_all \"git rm -f $SPARSE_CONE/a && git checkout HEAD -- $SPARSE_CONE/a\"\n-test_perf_on_all git grep --cached --sparse bogus -- \"f2/f1/f1/*\"\n+test_perf_on_all git grep --cached bogus -- \"f2/f1/f1/*\"\n \n test_done\n-- \n2.39.2.13.g1fb56cf030\n\n"},{"id":"473421","messageId":"20230312200856.323688-3-felipe.contreras@gmail.com","threadId":"59380","inReplyTo":"20230312200856.323688-1-felipe.contreras@gmail.com","subject":"[PATCH 2/5] perf: grep: fix prereqs","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-03-12T20:08:53Z","receivedAt":"2023-03-12T20:09:32Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Since 5dccd9155f (t/perf: add iteration setup mechanism to perf-lib,\n2022-04-04) they are in a --prereq option.\n\nCc: Neeraj Singh <neerajsi@microsoft.com>\nCc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/perf/p7821-grep-engines-fixed.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/perf/p7821-grep-engines-fixed.sh b/t/perf/p7821-grep-engines-fixed.sh\nindex 61e41b82cf..0d75240dae 100755\n--- a/t/perf/p7821-grep-engines-fixed.sh\n+++ b/t/perf/p7821-grep-engines-fixed.sh\n@@ -33,13 +33,13 @@ do\n \t\tfi\n \t\tif ! test_have_prereq PERF_GREP_ENGINES_THREADS\n \t\tthen\n-\t\t\ttest_perf $prereq \"$engine grep$GIT_PERF_7821_GREP_OPTS $pattern\" \"\n+\t\t\ttest_perf \"$engine grep$GIT_PERF_7821_GREP_OPTS $pattern\" --prereq \"$prereq\" \"\n \t\t\t\tgit -c grep.patternType=$engine grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine' || :\n \t\t\t\"\n \t\telse\n \t\t\tfor threads in $GIT_PERF_GREP_THREADS\n \t\t\tdo\n-\t\t\t\ttest_perf PTHREADS,$prereq \"$engine grep$GIT_PERF_7821_GREP_OPTS $pattern with $threads threads\" \"\n+\t\t\t\ttest_perf \"$engine grep$GIT_PERF_7821_GREP_OPTS $pattern with $threads threads\" --prereq \"$prereq\" \"\n \t\t\t\t\tgit -c grep.patternType=$engine -c grep.threads=$threads grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine.$threads' || :\n \t\t\t\t\"\n \t\t\tdone\n-- \n2.39.2.13.g1fb56cf030\n\n"},{"id":"473422","messageId":"20230312200856.323688-4-felipe.contreras@gmail.com","threadId":"59380","inReplyTo":"20230312200856.323688-1-felipe.contreras@gmail.com","subject":"[PATCH 3/5] perf: grep: don't check PRCE twice","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-03-12T20:08:54Z","receivedAt":"2023-03-12T20:09:36Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Just set the prereq and let the testing framework check it once.\n\nCc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/perf/p4220-log-grep-engines.sh       | 2 +-\n t/perf/p4221-log-grep-engines-fixed.sh | 2 +-\n t/perf/p7820-grep-engines.sh           | 2 +-\n t/perf/p7821-grep-engines-fixed.sh     | 2 +-\n 4 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/perf/p4220-log-grep-engines.sh b/t/perf/p4220-log-grep-engines.sh\nindex 03fbfbb85d..2c619a626f 100755\n--- a/t/perf/p4220-log-grep-engines.sh\n+++ b/t/perf/p4220-log-grep-engines.sh\n@@ -30,7 +30,7 @@ do\n \t\t\t# Poor man's basic -> extended converter.\n \t\t\tpattern=$(echo $pattern | sed 's/\\\\//g')\n \t\tfi\n-\t\tif test $engine = \"perl\" && ! test_have_prereq PCRE\n+\t\tif test $engine = \"perl\"\n \t\tthen\n \t\t\tprereq=\"PCRE\"\n \t\telse\ndiff --git a/t/perf/p4221-log-grep-engines-fixed.sh b/t/perf/p4221-log-grep-engines-fixed.sh\nindex 0a6d6dfc21..095c5d1765 100755\n--- a/t/perf/p4221-log-grep-engines-fixed.sh\n+++ b/t/perf/p4221-log-grep-engines-fixed.sh\n@@ -20,7 +20,7 @@ for pattern in 'int' 'uncommon' 'æ'\n do\n \tfor engine in fixed basic extended perl\n \tdo\n-\t\tif test $engine = \"perl\" && ! test_have_prereq PCRE\n+\t\tif test $engine = \"perl\"\n \t\tthen\n \t\t\tprereq=\"PCRE\"\n \t\telse\ndiff --git a/t/perf/p7820-grep-engines.sh b/t/perf/p7820-grep-engines.sh\nindex 9bfb86842a..336424cb00 100755\n--- a/t/perf/p7820-grep-engines.sh\n+++ b/t/perf/p7820-grep-engines.sh\n@@ -41,7 +41,7 @@ do\n \t\t\t# Poor man's basic -> extended converter.\n \t\t\tpattern=$(echo \"$pattern\" | sed 's/\\\\//g')\n \t\tfi\n-\t\tif test $engine = \"perl\" && ! test_have_prereq PCRE\n+\t\tif test $engine = \"perl\"\n \t\tthen\n \t\t\tprereq=\"PCRE\"\n \t\telse\ndiff --git a/t/perf/p7821-grep-engines-fixed.sh b/t/perf/p7821-grep-engines-fixed.sh\nindex 0d75240dae..79b1b9f8b2 100755\n--- a/t/perf/p7821-grep-engines-fixed.sh\n+++ b/t/perf/p7821-grep-engines-fixed.sh\n@@ -25,7 +25,7 @@ for pattern in 'int' 'uncommon' 'æ'\n do\n \tfor engine in fixed basic extended perl\n \tdo\n-\t\tif test $engine = \"perl\" && ! test_have_prereq PCRE\n+\t\tif test $engine = \"perl\"\n \t\tthen\n \t\t\tprereq=\"PCRE\"\n \t\telse\n-- \n2.39.2.13.g1fb56cf030\n\n"},{"id":"473423","messageId":"20230312200856.323688-6-felipe.contreras@gmail.com","threadId":"59380","inReplyTo":"20230312200856.323688-1-felipe.contreras@gmail.com","subject":"[PATCH 5/5] perf: aggregate: check if subtest exists","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-03-12T20:08:56Z","receivedAt":"2023-03-12T20:09:39Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"If no tests were run, for example in p7822-grep-perl-character.sh,\nthat's not a fatal error, just skip to the next one.\n\nCc: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/perf/aggregate.perl | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/perf/aggregate.perl b/t/perf/aggregate.perl\nindex 575d2000cc..a79451a0af 100755\n--- a/t/perf/aggregate.perl\n+++ b/t/perf/aggregate.perl\n@@ -156,6 +156,7 @@ sub sane_backticks {\n \t$t =~ s{(?:.*/)?(p(\\d+)-[^/]+)\\.sh$}{$1} or die \"bad test name: $t\";\n \tmy $n = $2;\n \tmy $fname = \"$resultsdir/$t.subtests\";\n+\tnext unless (-e $fname);\n \topen my $fp, \"<\", $fname or die \"cannot open $fname: $!\";\n \tfor (<$fp>) {\n \t\tchomp;\n-- \n2.39.2.13.g1fb56cf030\n\n"},{"id":"473424","messageId":"20230312200856.323688-5-felipe.contreras@gmail.com","threadId":"59380","inReplyTo":"20230312200856.323688-1-felipe.contreras@gmail.com","subject":"[PATCH 4/5] perf: grep: avoid unused prereq","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-03-12T20:08:55Z","receivedAt":"2023-03-12T20:09:41Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"There is no point in setting PERF_GREP_ENGINES_THREADS if we are going\nto check it ourselves.\n\nCc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/perf/p7820-grep-engines.sh        | 9 ++-------\n t/perf/p7821-grep-engines-fixed.sh  | 9 ++-------\n t/perf/p7822-grep-perl-character.sh | 7 +------\n 3 files changed, 5 insertions(+), 20 deletions(-)\n\ndiff --git a/t/perf/p7820-grep-engines.sh b/t/perf/p7820-grep-engines.sh\nindex 336424cb00..f80fdcb5e2 100755\n--- a/t/perf/p7820-grep-engines.sh\n+++ b/t/perf/p7820-grep-engines.sh\n@@ -22,11 +22,6 @@ etc.) we will test the patterns under those numbers of threads.\n test_perf_large_repo\n test_checkout_worktree\n \n-if test -n \"$GIT_PERF_GREP_THREADS\"\n-then\n-\ttest_set_prereq PERF_GREP_ENGINES_THREADS\n-fi\n-\n for pattern in \\\n \t'how.to' \\\n \t'^how to' \\\n@@ -47,7 +42,7 @@ do\n \t\telse\n \t\t\tprereq=\"\"\n \t\tfi\n-\t\tif ! test_have_prereq PERF_GREP_ENGINES_THREADS\n+\t\tif test -z \"$GIT_PERF_GREP_THREADS\"\n \t\tthen\n \t\t\ttest_perf \"$engine grep$GIT_PERF_7820_GREP_OPTS '$pattern'\" \\\n \t\t\t\t--prereq \"$prereq\" \"\n@@ -64,7 +59,7 @@ do\n \t\tfi\n \tdone\n \n-\tif ! test_have_prereq PERF_GREP_ENGINES_THREADS\n+\tif test -z \"$GIT_PERF_GREP_THREADS\"\n \tthen\n \t\ttest_expect_success \"assert that all engines found the same for$GIT_PERF_7820_GREP_OPTS '$pattern'\" '\n \t\t\ttest_cmp out.basic out.extended &&\ndiff --git a/t/perf/p7821-grep-engines-fixed.sh b/t/perf/p7821-grep-engines-fixed.sh\nindex 79b1b9f8b2..f25b4976ea 100755\n--- a/t/perf/p7821-grep-engines-fixed.sh\n+++ b/t/perf/p7821-grep-engines-fixed.sh\n@@ -16,11 +16,6 @@ etc.) we will test the patterns under those numbers of threads.\n test_perf_large_repo\n test_checkout_worktree\n \n-if test -n \"$GIT_PERF_GREP_THREADS\"\n-then\n-\ttest_set_prereq PERF_GREP_ENGINES_THREADS\n-fi\n-\n for pattern in 'int' 'uncommon' 'æ'\n do\n \tfor engine in fixed basic extended perl\n@@ -31,7 +26,7 @@ do\n \t\telse\n \t\t\tprereq=\"\"\n \t\tfi\n-\t\tif ! test_have_prereq PERF_GREP_ENGINES_THREADS\n+\t\tif test -z \"$GIT_PERF_GREP_THREADS\"\n \t\tthen\n \t\t\ttest_perf \"$engine grep$GIT_PERF_7821_GREP_OPTS $pattern\" --prereq \"$prereq\" \"\n \t\t\t\tgit -c grep.patternType=$engine grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine' || :\n@@ -46,7 +41,7 @@ do\n \t\tfi\n \tdone\n \n-\tif ! test_have_prereq PERF_GREP_ENGINES_THREADS\n+\tif test -z \"$GIT_PERF_GREP_THREADS\"\n \tthen\n \t\ttest_expect_success \"assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern\" '\n \t\t\ttest_cmp out.fixed out.basic &&\ndiff --git a/t/perf/p7822-grep-perl-character.sh b/t/perf/p7822-grep-perl-character.sh\nindex 87009c60df..2b73d41e2b 100755\n--- a/t/perf/p7822-grep-perl-character.sh\n+++ b/t/perf/p7822-grep-perl-character.sh\n@@ -11,11 +11,6 @@ etc.) we will test the patterns under those numbers of threads.\n test_perf_large_repo\n test_checkout_worktree\n \n-if test -n \"$GIT_PERF_GREP_THREADS\"\n-then\n-\ttest_set_prereq PERF_GREP_ENGINES_THREADS\n-fi\n-\n for pattern in \\\n \t'\\\\bhow' \\\n \t'\\\\bÆvar' \\\n@@ -24,7 +19,7 @@ for pattern in \\\n \t'\\\\w{12}\\\\b'\n do\n \techo '$pattern' >pat\n-\tif ! test_have_prereq PERF_GREP_ENGINES_THREADS\n+\tif test -z \"$GIT_PERF_GREP_THREADS\"\n \tthen\n \t\ttest_perf \"grep -P '$pattern'\" --prereq PCRE \"\n \t\t\tgit -P grep -f pat || :\n-- \n2.39.2.13.g1fb56cf030\n\n"}]}