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

[PATCH v2 7/9] perf/run: add run_subsection()

From
Christian Couder <chriscool@tuxfamily.org>
Date
Sep 23, 2017, 19:55 UTC
Message-ID
<0102015eb04f8a12-84068e82-d13c-48d5-8147-3525b95a5481-000000@eu-west-1.amazonses.com>
In-Reply-To
<0102015eb04f8927-439213ae-a464-4638-affa-f0d6484086c0-000000@eu-west-1.amazonses.com>

Let's actually use the subsections we find in the config file to run the perf tests separately for each subsection.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/perf/run | 47 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 35 insertions(+), 12 deletions(-)
diff --git a/t/perf/run b/t/perf/run
index bd39398b9cc7d..cb8687bfcf98d 100755
--- a/t/perf/run
+++ b/t/perf/run
@@ -125,23 +125,46 @@ get_var_from_env_or_config () {
 	test -n "${4+x}" && eval "$env_var=\"$4\""
 }
 
-get_var_from_env_or_config "GIT_PERF_REPEAT_COUNT" "perf" "repeatCount" 3
-export GIT_PERF_REPEAT_COUNT
+run_subsection () {
+	get_var_from_env_or_config "GIT_PERF_REPEAT_COUNT" "perf" "repeatCount" 3
+	export GIT_PERF_REPEAT_COUNT
 
-get_var_from_env_or_config "GIT_PERF_DIRS_OR_REVS" "perf" "dirsOrRevs"
-set -- $GIT_PERF_DIRS_OR_REVS "$@"
+	get_var_from_env_or_config "GIT_PERF_DIRS_OR_REVS" "perf" "dirsOrRevs"
+	set -- $GIT_PERF_DIRS_OR_REVS "$@"
 
-get_var_from_env_or_config "GIT_PERF_MAKE_COMMAND" "perf" "makeCommand"
-get_var_from_env_or_config "GIT_PERF_MAKE_OPTS" "perf" "makeOpts"
+	get_var_from_env_or_config "GIT_PERF_MAKE_COMMAND" "perf" "makeCommand"
+	get_var_from_env_or_config "GIT_PERF_MAKE_OPTS" "perf" "makeOpts"
 
-GIT_PERF_AGGREGATING_LATER=t
-export GIT_PERF_AGGREGATING_LATER
+	GIT_PERF_AGGREGATING_LATER=t
+	export GIT_PERF_AGGREGATING_LATER
+
+	if test $# = 0 -o "$1" = -- -o -f "$1"; then
+		set -- . "$@"
+	fi
+
+	run_dirs "$@"
+	./aggregate.perl "$@"
+}
 
 cd "$(dirname $0)"
 . ../../GIT-BUILD-OPTIONS
 
-if test $# = 0 -o "$1" = -- -o -f "$1"; then
-	set -- . "$@"
+mkdir -p test-results
+get_subsections "perf" >test-results/run_subsections.names
+
+if test $(wc -l <test-results/run_subsections.names) -eq 0
+then
+	(
+		run_subsection "$@"
+	)
+else
+	while read -r subsec
+	do
+		(
+			GIT_PERF_SUBSECTION="$subsec"
+			export GIT_PERF_SUBSECTION
+			echo "======== Run for subsection '$GIT_PERF_SUBSECTION' ========"
+			run_subsection "$@"
+		)
+	done <test-results/run_subsections.names
 fi
-run_dirs "$@"
-./aggregate.perl "$@"

--
https://github.com/git/git/pull/408
Previous: Christian CouderNext: Junio C Hamano
Message 9 of 14 in “perf/run: add '--config' option to the 'run' script”
  1. 1/9 perf/run: add '--config' option to the 'run' scriptChristian Couder, Sep 23, 2017
  2. 4/9 perf/run: add calls to get_var_from_env_or_config()Christian Couder, Sep 23, 2017
  3. 8/9 perf/run: show name of rev being builtChristian Couder, Sep 23, 2017
  4. 9/9 perf: store subsection results in "test-results/$GIT_PERF_SUBSECTION/"Christian Couder, Sep 23, 2017
  5. 2/9 perf/run: add get_var_from_env_or_config()Christian Couder, Sep 23, 2017
  6. 5/9 perf/run: add get_subsections()Christian Couder, Sep 23, 2017
  7. 6/9 perf/run: update get_var_from_env_or_config() for subsectionsChristian Couder, Sep 23, 2017
  8. 3/9 perf/run: add GIT_PERF_DIRS_OR_REVSChristian Couder, Sep 23, 2017
  9. 7/9 perf/run: add run_subsection()Christian Couder, Sep 23, 2017
  10. Junio C HamanoOct 16, 2017
  11. Christian CouderNov 17, 2017
  12. Ævar Arnfjörð BjarmasonNov 24, 2017
  13. Kevin DaudtOct 18, 2017
  14. Christian CouderOct 18, 2017

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.