git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Git List <git@vger.kernel.org>
Cc: Jeff Hostetler <git@jeffhostetler.com>,
	Jeff Hostetler <jeffhost@microsoft.com>
Subject: [PATCH 3/5] p0004: use test_perf
Date: Sat, 13 May 2017 18:02:32 +0200	[thread overview]
Message-ID: <5d8cff82-c695-ea6a-4d82-448dc10b8b63@web.de> (raw)
In-Reply-To: <9b574d73-8dfb-f0b3-dc3e-d593726a8f0e@web.de>

The perf test suite (more specifically: t/perf/aggregate.perl) requires
each test script to write test results into a file, otherwise it aborts
when aggregating.  Add actual performance tests with test_perf to allow
p0004 to be run together with other perf scripts.

Calibrate the value for the parameter --count based on the size of the
test repository, in order to get meaningful results with smaller repos
yet still be able to finish the script against huge ones without having
to wait for hours.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
The numbers are just guesses; I didn't actually test all ranges.

 t/perf/p0004-lazy-init-name-hash.sh | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/t/perf/p0004-lazy-init-name-hash.sh b/t/perf/p0004-lazy-init-name-hash.sh
index 576bdc3c4e..d30c32f97b 100755
--- a/t/perf/p0004-lazy-init-name-hash.sh
+++ b/t/perf/p0004-lazy-init-name-hash.sh
@@ -18,4 +18,40 @@ test_expect_success 'multithreaded should be faster' '
 	test-lazy-init-name-hash --perf >out.perf
 '
 
+test_expect_success 'calibrate' '
+	entries=$(wc -l <out.single) &&
+
+	case $entries in
+	?) count=1000000 ;;
+	??) count=100000 ;;
+	???) count=10000 ;;
+	????) count=1000 ;;
+	?????) count=100 ;;
+	??????) count=10 ;;
+	*) count=1 ;;
+	esac &&
+	export count &&
+
+	case $entries in
+	1) entries_desc="1 entry" ;;
+	*) entries_desc="$entries entries" ;;
+	esac &&
+
+	case $count in
+	1) count_desc="1 round" ;;
+	*) count_desc="$count rounds" ;;
+	esac &&
+
+	desc="$entries_desc, $count_desc" &&
+	export desc
+'
+
+test_perf "single-threaded, $desc" "
+	test-lazy-init-name-hash --single --count=$count
+"
+
+test_perf "multi-threaded, $desc" "
+	test-lazy-init-name-hash --multi --count=$count
+"
+
 test_done
-- 
2.12.2


  parent reply	other threads:[~2017-05-13 16:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 15:55 [PATCH 0/5] p0004: support being called by t/perf/run René Scharfe
2017-05-13 15:59 ` [PATCH 1/5] p0004: simplify calls of test-lazy-init-name-hash René Scharfe
2017-05-13 16:00 ` [PATCH 2/5] p0004: avoid using pipes René Scharfe
2017-05-13 16:02 ` René Scharfe [this message]
2017-05-13 16:03 ` [PATCH 4/5] p0004: don't abort if multi-threaded is too slow René Scharfe
2017-05-13 16:03 ` [PATCH 5/5] p0004: don't error out if test repo is too small René Scharfe
2017-05-15 13:14 ` [PATCH 0/5] p0004: support being called by t/perf/run 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=5d8cff82-c695-ea6a-4d82-448dc10b8b63@web.de \
    --to=l.s.r@web.de \
    --cc=git@jeffhostetler.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 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 NNTP newsgroup(s).