From: "Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Jeff Hostetler <jeffhost@microsoft.com>,
Jeff Hostetler <jeffhost@microsoft.com>
Subject: [PATCH] t/perf/perf-lib.sh: remove test_times.* at the end test_perf_()
Date: Mon, 04 Oct 2021 22:29:03 +0000 [thread overview]
Message-ID: <pull.1051.git.1633386543759.gitgitgadget@gmail.com> (raw)
From: Jeff Hostetler <jeffhost@microsoft.com>
Teach test_perf_() to remove the temporary test_times.* files
at the end of each test.
test_perf_() runs a particular GIT_PERF_REPEAT_COUNT times and creates
./test_times.[123...]. It then uses a perl script to find the minimum
over "./test_times.*" (note the wildcard) and writes that time to
"test-results/<testname>.<testnumber>.result".
If the repeat count is changed during the pXXXX test script, stale
test_times.* files (from previous steps) may be included in the min()
computation. For example:
...
GIT_PERF_REPEAT_COUNT=3 \
test_perf "status" "
git status
"
GIT_PERF_REPEAT_COUNT=1 \
test_perf "checkout other" "
git checkout other
"
...
The time reported in the summary for "XXXX.2 checkout other" would
be "min( checkout[1], status[2], status[3] )".
We prevent that error by removing the test_times.* files at the end of
each test.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
---
t/perf/perf-lib.sh: remove test_times.* at the end test_perf_()
Teach test_perf_() to remove the temporary test_times.* files at the end
of each test.
test_perf_() runs a particular GIT_PERF_REPEAT_COUNT times and creates
./test_times.[123...]. It then uses a perl script to find the minimum
over "./test_times.*" (note the wildcard) and writes that time to
"test-results/..result".
If the repeat count is changed during the pXXXX test script, stale
test_times.* files (from previous steps) may be included in the min()
computation. For example:
... GIT_PERF_REPEAT_COUNT=3
test_perf "status" " git status "
GIT_PERF_REPEAT_COUNT=1
test_perf "checkout other" " git checkout other " ...
The time reported in the summary for "XXXX.2 checkout other" would be
"min( checkout[1], status[2], status[3] )".
We prevent that error by removing the test_times.* files at the end of
each test.
Signed-off-by: Jeff Hostetler jeffhost@microsoft.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1051%2Fjeffhostetler%2Fperf-test-remove-test-times-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1051/jeffhostetler/perf-test-remove-test-times-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1051
t/perf/perf-lib.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index f5ed092ee59..a1b5d2804dc 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -230,6 +230,7 @@ test_perf_ () {
test_ok_ "$1"
fi
"$TEST_DIRECTORY"/perf/min_time.perl test_time.* >"$base".result
+ rm test_time.*
}
test_perf () {
base-commit: 0785eb769886ae81e346df10e88bc49ffc0ac64e
--
gitgitgadget
next reply other threads:[~2021-10-04 22:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-04 22:29 Jeff Hostetler via GitGitGadget [this message]
2021-10-05 17:45 ` [PATCH] t/perf/perf-lib.sh: remove test_times.* at the end test_perf_() Taylor Blau
2021-10-06 19:24 ` Jeff King
2021-10-06 19:26 ` Taylor Blau
2021-10-07 17:49 ` Jeff Hostetler
2021-10-08 2:55 ` Jeff King
2021-10-08 7:47 ` A hard dependency on "hyperfine" for t/perf Ævar Arnfjörð Bjarmason
2021-10-08 17:30 ` [PATCH] t/perf/perf-lib.sh: remove test_times.* at the end test_perf_() Junio C Hamano
2021-10-08 19:57 ` Jeff King
2021-10-10 21:26 ` SZEDER Gábor
2021-10-13 21:09 ` Jeff Hostetler
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.1051.git.1633386543759.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=jeffhost@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.