git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Taylor Blau <me@ttaylorr.com>
Cc: Jeff Hostetler via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: [PATCH] t/perf/perf-lib.sh: remove test_times.* at the end test_perf_()
Date: Wed, 6 Oct 2021 15:24:07 -0400	[thread overview]
Message-ID: <YV3314Dnhj7srFZ4@coredump.intra.peff.net> (raw)
In-Reply-To: <YVyPH59LpxFLHep0@nand.local>

On Tue, Oct 05, 2021 at 01:45:03PM -0400, Taylor Blau wrote:

> > GIT_PERF_REPEAT_COUNT=3 \
> > test_perf "status" "
> > 	git status
> > "
> >
> > GIT_PERF_REPEAT_COUNT=1 \
> > test_perf "checkout other" "
> > 	git checkout other
> > "
> [...]
> 
> Well explained, and makes sense to me. I didn't know we set
> GIT_PERF_REPEAT_COUNT inline with the performance tests themselves, but
> grepping shows that we do it in the fsmonitor tests.

Neither did I. IMHO that is a hack that we would do better to avoid, as
the point of it is to let the user drive the decision of time versus
quality of results. So the first example above is spending extra time
that the user may have asked us not to, and the second is getting less
significant results by not repeating the trial.

Presumably the issue in the second one is that the test modifies state.
The "right" solution there is to give test_perf() a way to set up the
state between trials (you can do it in the test_perf block, but you'd
want to avoid letting the setup step affect the timing).

I'd also note that

  GIT_PERF_REPEAT_COUNT=1 \
  test_perf ...

in the commit message is a bad pattern. On some shells, the one-shot
variable before a function will persist after the function returns (so
it would accidentally tweak the count for later tests, too).

All that said, I do think cleaning up the test_time files after each
test_perf is a good precuation, even if I don't think it's a good idea
in general to flip the REPEAT_COUNT variable in the middle of a test.

-Peff

  reply	other threads:[~2021-10-06 19:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 22:29 [PATCH] t/perf/perf-lib.sh: remove test_times.* at the end test_perf_() Jeff Hostetler via GitGitGadget
2021-10-05 17:45 ` Taylor Blau
2021-10-06 19:24   ` Jeff King [this message]
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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=YV3314Dnhj7srFZ4@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=jeffhost@microsoft.com \
    --cc=me@ttaylorr.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).