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

Re: [PATCH] perf-lib: remove old result files before running tests

From
Thomas Gummerer <t.gummerer@gmail.com>
Date
Nov 22, 2019, 08:11 UTC
Message-ID
<20191122081108.GA38815@cat>
In-Reply-To
<20191121102042.GA2611@sigill.intra.peff.net>
On 11/21, Jeff King wrote:
Show 8 quoted lines
> But I wonder if it would be simpler to just always use the same file for
> the test result, overwriting it each time, and let the reader figure out
> the type. The aggregate script's get_times() already uses a regex to
> distinguish the two. That's enough for the two types we have, and we
> could later add a header line if it becomes necessary.
> 
> Something like the patch below. That removes any confusion about cruft
> files being left behind, or which file should be preferred, etc.
Yeah, I like what you have below much more than what I had, thanks!
> The diff would be even smaller if we just kept calling it "times", but
> that's probably unnecessarily confusing.
Yup, I prefer a more readable end result to a small diff :)
Show 62 quoted lines
> -Peff
> 
> ---
> diff --git a/t/perf/aggregate.perl b/t/perf/aggregate.perl
> index 66554d2161..112fc23dbe 100755
> --- a/t/perf/aggregate.perl
> +++ b/t/perf/aggregate.perl
> @@ -219,13 +219,7 @@ sub print_default_results {
>  		for my $i (0..$#dirs) {
>  			my $d = $dirs[$i];
>  			my $base = "$resultsdir/$prefixes{$d}$t";
> -			$times{$prefixes{$d}.$t} = [];
> -			foreach my $type (qw(times size)) {
> -				if (-e "$base.$type") {
> -					$times{$prefixes{$d}.$t} = [get_times("$base.$type")];
> -					last;
> -				}
> -			}
> +			$times{$prefixes{$d}.$t} = [get_times("$base.result")];
>  			my ($r,$u,$s) = @{$times{$prefixes{$d}.$t}};
>  			my $w = length format_times($r,$u,$s,$firstr);
>  			$colwidth[$i] = $w if $w > $colwidth[$i];
> @@ -267,7 +261,7 @@ sub print_sorted_results {
>  		my ($prevr, $prevu, $prevs, $prevrev);
>  		for my $i (0..$#dirs) {
>  			my $d = $dirs[$i];
> -			my ($r, $u, $s) = get_times("$resultsdir/$prefixes{$d}$t.times");
> +			my ($r, $u, $s) = get_times("$resultsdir/$prefixes{$d}$t.result");
>  			if ($i > 0 and defined $r and defined $prevr and $prevr > 0) {
>  				my $percent = 100.0 * ($r - $prevr) / $prevr;
>  				push @evolutions, { "percent"  => $percent,
> @@ -327,7 +321,7 @@ sub print_codespeed_results {
>  			my $commitid = $prefixes{$d};
>  			$commitid =~ s/^build_//;
>  			$commitid =~ s/\.$//;
> -			my ($result_value, $u, $s) = get_times("$resultsdir/$prefixes{$d}$t.times");
> +			my ($result_value, $u, $s) = get_times("$resultsdir/$prefixes{$d}$t.result");
>  
>  			my %vals = (
>  				"commitid" => $commitid,
> diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
> index b58a43ea43..13e389367a 100644
> --- a/t/perf/perf-lib.sh
> +++ b/t/perf/perf-lib.sh
> @@ -214,7 +214,7 @@ test_perf_ () {
>  	else
>  		test_ok_ "$1"
>  	fi
> -	"$TEST_DIRECTORY"/perf/min_time.perl test_time.* >"$base".times
> +	"$TEST_DIRECTORY"/perf/min_time.perl test_time.* >"$base".result
>  }
>  
>  test_perf () {
> @@ -223,7 +223,7 @@ test_perf () {
>  
>  test_size_ () {
>  	say >&3 "running: $2"
> -	if test_eval_ "$2" 3>"$base".size; then
> +	if test_eval_ "$2" 3>"$base".result; then
>  		test_ok_ "$1"
>  	else
>  		test_failure_ "$@"
Previous: Jeff KingNext: Jeff King
Message 5 of 7 in “perf-lib: remove old result files before running tests”
  1. perf-lib: remove old result files before running testsThomas Gummerer, Nov 19, 2019
  2. Junio C HamanoNov 20, 2019
  3. Thomas GummererNov 20, 2019
  4. Jeff KingNov 21, 2019
  5. Thomas GummererNov 22, 2019
  6. Jeff KingNov 25, 2019
  7. Thomas GummererNov 25, 2019

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.