git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v1 0/2] perf/aggregate: sort result by regression
@ 2018-03-23 14:00 Christian Couder
  2018-03-23 14:00 ` [PATCH v1 1/2] perf/aggregate: add display_dir() Christian Couder
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Christian Couder @ 2018-03-23 14:00 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Thomas Rast,
	Ævar Arnfjörð Bjarmason, Christian Couder,
	Eric Sunshine, Philip Oakley

This small patch series makes it easy to spot big performance
regressions, so that they can later be investigated.

For example:

$ ./aggregate.perl --sortbyregression --subsection "without libpcre" v2.14.3 v2.15.1 v2.16.2 p4220-log-grep-engines.sh 
+5.0% p4220-log-grep-engines.2 0.60(0.58+0.02) 0.63(0.59+0.04) v2.14.3 v2.15.1
+4.5% p4220-log-grep-engines.10 0.67(0.64+0.03) 0.70(0.67+0.02) v2.14.3 v2.15.1
+1.7% p4220-log-grep-engines.5 0.58(0.57+0.01) 0.59(0.59+0.00) v2.14.3 v2.15.1
+1.7% p4220-log-grep-engines.6 0.58(0.58+0.00) 0.59(0.56+0.02) v2.14.3 v2.15.1
+1.7% p4220-log-grep-engines.17 0.58(0.57+0.01) 0.59(0.56+0.02) v2.14.3 v2.15.1
+1.7% p4220-log-grep-engines.1 0.60(0.58+0.01) 0.61(0.60+0.01) v2.14.3 v2.15.1
+1.6% p4220-log-grep-engines.13 0.64(0.63+0.02) 0.65(0.63+0.01) v2.14.3 v2.15.1
+1.5% p4220-log-grep-engines.9 0.67(0.66+0.01) 0.68(0.67+0.01) v2.14.3 v2.15.1
+0.0% p4220-log-grep-engines.14 0.65(0.62+0.02) 0.65(0.63+0.02) v2.14.3 v2.15.1
+0.0% p4220-log-grep-engines.18 0.58(0.57+0.00) 0.58(0.56+0.02) v2.14.3 v2.15.1
-1.5% p4220-log-grep-engines.13 0.65(0.63+0.01) 0.64(0.62+0.01) v2.15.1 v2.16.2
-1.5% p4220-log-grep-engines.14 0.65(0.63+0.02) 0.64(0.60+0.03) v2.15.1 v2.16.2
-1.6% p4220-log-grep-engines.1 0.61(0.60+0.01) 0.60(0.58+0.02) v2.15.1 v2.16.2
-1.7% p4220-log-grep-engines.5 0.59(0.59+0.00) 0.58(0.55+0.02) v2.15.1 v2.16.2
-1.7% p4220-log-grep-engines.6 0.59(0.56+0.02) 0.58(0.55+0.02) v2.15.1 v2.16.2
-1.7% p4220-log-grep-engines.18 0.58(0.56+0.02) 0.57(0.55+0.02) v2.15.1 v2.16.2
-2.9% p4220-log-grep-engines.9 0.68(0.67+0.01) 0.66(0.64+0.02) v2.15.1 v2.16.2
-3.4% p4220-log-grep-engines.17 0.59(0.56+0.02) 0.57(0.55+0.01) v2.15.1 v2.16.2
-4.3% p4220-log-grep-engines.10 0.70(0.67+0.02) 0.67(0.66+0.01) v2.15.1 v2.16.2
-4.8% p4220-log-grep-engines.2 0.63(0.59+0.04) 0.60(0.57+0.03) v2.15.1 v2.16.2

Christian Couder (2):
  perf/aggregate: add display_dir()
  perf/aggregate: add --sortbyregression option

 t/perf/aggregate.perl | 59 +++++++++++++++++++++++++++++++++++++++----
 1 file changed, 54 insertions(+), 5 deletions(-)

-- 
2.17.0.rc0.37.g8f476fabe9


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 1/2] perf/aggregate: add display_dir()
  2018-03-23 14:00 [PATCH v1 0/2] perf/aggregate: sort result by regression Christian Couder
@ 2018-03-23 14:00 ` Christian Couder
  2018-03-23 14:00 ` [PATCH v1 2/2] perf/aggregate: add --sortbyregression option Christian Couder
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Christian Couder @ 2018-03-23 14:00 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Thomas Rast,
	Ævar Arnfjörð Bjarmason, Christian Couder,
	Eric Sunshine, Philip Oakley

This new helper function will be reused in a subsequent
commit.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/perf/aggregate.perl | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/t/perf/aggregate.perl b/t/perf/aggregate.perl
index 821cf1498b..b9c0e3243d 100755
--- a/t/perf/aggregate.perl
+++ b/t/perf/aggregate.perl
@@ -147,6 +147,11 @@ sub have_slash {
 	return 0;
 }
 
+sub display_dir {
+    my ($d) = @_;
+    return exists $dirabbrevs{$d} ? $dirabbrevs{$d} : $dirnames{$d};
+}
+
 sub print_default_results {
 	my %descrs;
 	my $descrlen = 4; # "Test"
@@ -168,8 +173,7 @@ sub print_default_results {
 	my %times;
 	my @colwidth = ((0)x@dirs);
 	for my $i (0..$#dirs) {
-		my $d = $dirs[$i];
-		my $w = length (exists $dirabbrevs{$d} ? $dirabbrevs{$d} : $dirnames{$d});
+		my $w = length display_dir($dirs[$i]);
 		$colwidth[$i] = $w if $w > $colwidth[$i];
 	}
 	for my $t (@subtests) {
@@ -188,8 +192,7 @@ sub print_default_results {
 
 	printf "%-${descrlen}s", "Test";
 	for my $i (0..$#dirs) {
-		my $d = $dirs[$i];
-		printf "   %-$colwidth[$i]s", (exists $dirabbrevs{$d} ? $dirabbrevs{$d} : $dirnames{$d});
+		printf "   %-$colwidth[$i]s", display_dir($dirs[$i]);
 	}
 	print "\n";
 	print "-"x$totalwidth, "\n";
-- 
2.17.0.rc0.37.g8f476fabe9


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 2/2] perf/aggregate: add --sortbyregression option
  2018-03-23 14:00 [PATCH v1 0/2] perf/aggregate: sort result by regression Christian Couder
  2018-03-23 14:00 ` [PATCH v1 1/2] perf/aggregate: add display_dir() Christian Couder
@ 2018-03-23 14:00 ` Christian Couder
  2018-03-23 14:08 ` [PATCH v1 0/2] perf/aggregate: sort result by regression Christian Couder
  2018-03-23 21:16 ` Junio C Hamano
  3 siblings, 0 replies; 6+ messages in thread
From: Christian Couder @ 2018-03-23 14:00 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Thomas Rast,
	Ævar Arnfjörð Bjarmason, Christian Couder,
	Eric Sunshine, Philip Oakley

One of the most interesting thing one can be interested
in when looking at performance test results is possible
performance regressions.

This new option makes it easy to spot such possible
regressions.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/perf/aggregate.perl | 48 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/t/perf/aggregate.perl b/t/perf/aggregate.perl
index b9c0e3243d..9d032b286e 100755
--- a/t/perf/aggregate.perl
+++ b/t/perf/aggregate.perl
@@ -37,7 +37,7 @@ sub format_times {
 }
 
 my (@dirs, %dirnames, %dirabbrevs, %prefixes, @tests,
-    $codespeed, $subsection, $reponame);
+    $codespeed, $sortbyregression, $subsection, $reponame);
 while (scalar @ARGV) {
 	my $arg = $ARGV[0];
 	my $dir;
@@ -46,6 +46,11 @@ while (scalar @ARGV) {
 		shift @ARGV;
 		next;
 	}
+	if ($arg eq "--sortbyregression") {
+		$sortbyregression = 1;
+		shift @ARGV;
+		next;
+	}
 	if ($arg eq "--subsection") {
 		shift @ARGV;
 		$subsection = $ARGV[0];
@@ -209,6 +214,45 @@ sub print_default_results {
 	}
 }
 
+sub print_sortbyregression_results {
+	my ($subsection) = @_;
+
+	my @evolutions;
+	for my $t (@subtests) {
+		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");
+			if ($i > 0 and defined $r and defined $prevr and $prevr > 0) {
+			    my $percent = 100.0 * ($r - $prevr) / $prevr;
+			    push @evolutions, { "percent"  => $percent,
+						"test"     => $t,
+						"prevrev"  => $prevrev,
+						"rev"      => $d,
+						"prevr"    => $prevr,
+						"r"        => $r,
+						"prevu"    => $prevu,
+						"u"        => $u,
+						"prevs"    => $prevs,
+						"s"        => $s};
+			}
+			($prevr, $prevu, $prevs, $prevrev) = ($r, $u, $s, $d);
+		}
+	}
+
+	my @sorted_evolutions = sort { $b->{percent} <=> $a->{percent} } @evolutions;
+
+	for my $e (@sorted_evolutions) {
+	    printf "%+.1f%%", $e->{percent};
+	    print " " . $e->{test};
+	    print " " . format_times($e->{prevr}, $e->{prevu}, $e->{prevs});
+	    print " " . format_times($e->{r}, $e->{u}, $e->{s});
+	    print " " . display_dir($e->{prevrev});
+	    print " " . display_dir($e->{rev});
+	    print "\n";
+	}
+}
+
 sub print_codespeed_results {
 	my ($subsection) = @_;
 
@@ -263,6 +307,8 @@ binmode STDOUT, ":utf8" or die "PANIC on binmode: $!";
 
 if ($codespeed) {
 	print_codespeed_results($subsection);
+} elsif ($sortbyregression) {
+	print_sortbyregression_results($subsection);
 } else {
 	print_default_results();
 }
-- 
2.17.0.rc0.37.g8f476fabe9


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 0/2] perf/aggregate: sort result by regression
  2018-03-23 14:00 [PATCH v1 0/2] perf/aggregate: sort result by regression Christian Couder
  2018-03-23 14:00 ` [PATCH v1 1/2] perf/aggregate: add display_dir() Christian Couder
  2018-03-23 14:00 ` [PATCH v1 2/2] perf/aggregate: add --sortbyregression option Christian Couder
@ 2018-03-23 14:08 ` Christian Couder
  2018-03-23 21:16 ` Junio C Hamano
  3 siblings, 0 replies; 6+ messages in thread
From: Christian Couder @ 2018-03-23 14:08 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jeff King, Thomas Rast,
	Ævar Arnfjörð Bjarmason, Christian Couder,
	Eric Sunshine, Philip Oakley

On Fri, Mar 23, 2018 at 3:00 PM, Christian Couder
<christian.couder@gmail.com> wrote:
> This small patch series makes it easy to spot big performance
> regressions, so that they can later be investigated.

Sorry I just realized there are indent problems in the patches.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 0/2] perf/aggregate: sort result by regression
  2018-03-23 14:00 [PATCH v1 0/2] perf/aggregate: sort result by regression Christian Couder
                   ` (2 preceding siblings ...)
  2018-03-23 14:08 ` [PATCH v1 0/2] perf/aggregate: sort result by regression Christian Couder
@ 2018-03-23 21:16 ` Junio C Hamano
  2018-03-24  7:05   ` Christian Couder
  3 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2018-03-23 21:16 UTC (permalink / raw)
  To: Christian Couder
  Cc: git, Jeff King, Thomas Rast,
	Ævar Arnfjörð Bjarmason, Christian Couder,
	Eric Sunshine, Philip Oakley

Christian Couder <christian.couder@gmail.com> writes:

> This small patch series makes it easy to spot big performance
> regressions, so that they can later be investigated.
>
> For example:
>
> $ ./aggregate.perl --sortbyregression --subsection "without libpcre" v2.14.3 v2.15.1 v2.16.2 p4220-log-grep-engines.sh 

Are we comfortable with the idea that other kinds of sorting, when
invented in the future, would have to say

    $ ./aggregate.perl --sortbysomethingelse --subsection "without libpcre" \
        A B C p4220-log-grep-engines.sh

or will we regret that and wish if we could write it as

    $ ./aggregate.perl --sort-by=somethingelse --subsection "without libpcre" \
        A B C p4220-log-grep-engines.sh

If the latter, perhaps we should use --soft-by=regression from day one.

Do we expect that "taking a lot more more rtime than the previous"
will stay to be the only kind of "regression" we care about in the
context of t/perf?  If so, there is no need for further suggestion,
but if not, perhaps we should plan if/how we could also parameterize
the "rtime" part from the command line.  E.g.

    $ ./aggregate.perl --sort-by=regression:stime

might be a way to say "we only care about the stime part" in the
future, even though --sort-by=regression may be a short-hand to say
"we care about rtime regression" i.e. "--sort-by=regression:rtime".


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 0/2] perf/aggregate: sort result by regression
  2018-03-23 21:16 ` Junio C Hamano
@ 2018-03-24  7:05   ` Christian Couder
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Couder @ 2018-03-24  7:05 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Jeff King, Thomas Rast,
	Ævar Arnfjörð Bjarmason, Christian Couder,
	Eric Sunshine, Philip Oakley

On Fri, Mar 23, 2018 at 10:16 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Christian Couder <christian.couder@gmail.com> writes:
>
>> This small patch series makes it easy to spot big performance
>> regressions, so that they can later be investigated.
>>
>> For example:
>>
>> $ ./aggregate.perl --sortbyregression --subsection "without libpcre" v2.14.3 v2.15.1 v2.16.2 p4220-log-grep-engines.sh
>
> Are we comfortable with the idea that other kinds of sorting, when
> invented in the future, would have to say
>
>     $ ./aggregate.perl --sortbysomethingelse --subsection "without libpcre" \
>         A B C p4220-log-grep-engines.sh
>
> or will we regret that and wish if we could write it as
>
>     $ ./aggregate.perl --sort-by=somethingelse --subsection "without libpcre" \
>         A B C p4220-log-grep-engines.sh
>
> If the latter, perhaps we should use --soft-by=regression from day one.

Yeah, I think it is probably better to use --sort-by=regression (not
--soft-by ;-), so I will use that in the next version.

> Do we expect that "taking a lot more more rtime than the previous"
> will stay to be the only kind of "regression" we care about in the
> context of t/perf?  If so, there is no need for further suggestion,
> but if not, perhaps we should plan if/how we could also parameterize
> the "rtime" part from the command line.  E.g.
>
>     $ ./aggregate.perl --sort-by=regression:stime
>
> might be a way to say "we only care about the stime part" in the
> future, even though --sort-by=regression may be a short-hand to say
> "we care about rtime regression" i.e. "--sort-by=regression:rtime".

Yeah, I think we can have the short form "--sort-by=regression" mean
"--sort-by=regression:rtime" and skip implementing the long form. I
will talk about the long form in the commit message.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-24  7:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-23 14:00 [PATCH v1 0/2] perf/aggregate: sort result by regression Christian Couder
2018-03-23 14:00 ` [PATCH v1 1/2] perf/aggregate: add display_dir() Christian Couder
2018-03-23 14:00 ` [PATCH v1 2/2] perf/aggregate: add --sortbyregression option Christian Couder
2018-03-23 14:08 ` [PATCH v1 0/2] perf/aggregate: sort result by regression Christian Couder
2018-03-23 21:16 ` Junio C Hamano
2018-03-24  7:05   ` Christian Couder

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