mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <>
Subject: [PATCH 1/3] p5302: disable thread-count parameter tests by default
Date: Fri, 21 Aug 2020 13:53:39 -0400	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

The primary function of the perf suite is to detect regressions (or
improvements) between versions of Git. The only numbers we show a direct
comparison for are timings between the same test run on two different

However, it can sometimes be used to collect other information.  For
instance, p5302 runs the same index-pack operation with different thread
counts. The output doesn't directly compare these, but anybody
interested in working on index-pack can manually compare the results.

For a normal regression run of the full perf-suite, though, this incurs
a significant cost to generate numbers nobody will actually look at;
about 25% of the total time of the test suite is spent in p5302. And the
low-thread-count runs are the most expensive part of it, since they're
(unsurprisingly) not using as many threads.

Let's skip these tests by default, but make it possible for people
working on index-pack to still run them by setting an environment
variable. Rather than make this specific to p5302, let's introduce a
generic mechanism. This makes it possible to run the full suite with
every possible test if somebody really wants to burn some CPU.

Signed-off-by: Jeff King <>
 t/perf/README              |  9 +++++++++
 t/perf/ | 10 +++++-----
 t/perf/         |  2 ++
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/t/perf/README b/t/perf/README
index c7b70e2d28..bd649afa97 100644
--- a/t/perf/README
+++ b/t/perf/README
@@ -84,6 +84,15 @@ You can set the following variables (also in your config.mak):
 	probably be about linux.git size for optimal results.
 	Both default to the git.git you are running from.
+	Boolean to enable additional tests. Most test scripts are
+	written to detect regressions between two versions of Git, and
+	the output will compare timings for individual tests between
+	those versions. Some scripts have additional tests which are not
+	run by default, that show patterns within a single version of
+	Git (e.g., performance of index-pack as the number of threads
+	changes). These can be enabled with GIT_PERF_EXTRA.
 You can also pass the options taken by ordinary git tests; the most
 useful one is:
diff --git a/t/perf/ b/t/perf/
index a9b3e112d9..23011ab739 100755
--- a/t/perf/
+++ b/t/perf/
@@ -13,31 +13,31 @@ test_expect_success 'repack' '
 	export PACK
-test_perf 'index-pack 0 threads' '
+test_perf PERF_EXTRA 'index-pack 0 threads' '
 	rm -rf repo.git &&
 	git init --bare repo.git &&
 	GIT_DIR=repo.git git index-pack --threads=1 --stdin < $PACK
-test_perf 'index-pack 1 thread ' '
+test_perf PERF_EXTRA 'index-pack 1 thread ' '
 	rm -rf repo.git &&
 	git init --bare repo.git &&
 	GIT_DIR=repo.git GIT_FORCE_THREADS=1 git index-pack --threads=1 --stdin < $PACK
-test_perf 'index-pack 2 threads' '
+test_perf PERF_EXTRA 'index-pack 2 threads' '
 	rm -rf repo.git &&
 	git init --bare repo.git &&
 	GIT_DIR=repo.git git index-pack --threads=2 --stdin < $PACK
-test_perf 'index-pack 4 threads' '
+test_perf PERF_EXTRA 'index-pack 4 threads' '
 	rm -rf repo.git &&
 	git init --bare repo.git &&
 	GIT_DIR=repo.git git index-pack --threads=4 --stdin < $PACK
-test_perf 'index-pack 8 threads' '
+test_perf PERF_EXTRA 'index-pack 8 threads' '
 	rm -rf repo.git &&
 	git init --bare repo.git &&
 	GIT_DIR=repo.git git index-pack --threads=8 --stdin < $PACK
diff --git a/t/perf/ b/t/perf/
index 13e389367a..821581a885 100644
--- a/t/perf/
+++ b/t/perf/
@@ -245,3 +245,5 @@ test_at_end_hook_ () {
 test_export () {
 	export "$@"
+test_lazy_prereq PERF_EXTRA 'test_bool_env GIT_PERF_EXTRA false'

  reply	other threads:[~2020-08-21 17:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 17:51 [PATCH 0/3] index-pack threading defaults Jeff King
2020-08-21 17:53 ` Jeff King [this message]
2020-08-21 17:54 ` [PATCH 2/3] p5302: count up to online-cpus for thread tests Jeff King
2020-08-21 17:58   ` Jeff King
2020-08-21 17:58 ` [PATCH 3/3] index-pack: adjust default threading cap Jeff King
2020-08-21 18:08   ` Eric Sunshine
2020-08-21 18:41     ` Jeff King
2020-08-22  1:16   ` brian m. carlson
2020-08-24 17:37     ` Jeff King
2020-08-24 17:55       ` Eric Sunshine
2020-08-21 18:44 ` [PATCH 0/3] index-pack threading defaults Jeff King
2020-08-21 18:59   ` Junio C Hamano
2020-08-21 19:14     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).