This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bench.pl: fix --sort and --compact options
authorDavid Mitchell <davem@iabyn.com>
Mon, 10 Oct 2016 16:10:16 +0000 (17:10 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 26 Oct 2016 07:37:27 +0000 (08:37 +0100)
They were using the full pathname of the perl executable to index into
a hash indexed by label.

Porting/bench.pl

index a2875a1..be46c0e 100755 (executable)
@@ -1152,7 +1152,7 @@ sub sorted_test_names {
     unless ($OPTS{average}) {
         if (defined $OPTS{'sort-field'}) {
             my ($field, $perlix) = @OPTS{'sort-field', 'sort-perl'};
-            my $perl = $perls->[$perlix][0];
+            my $perl = $perls->[$perlix][1];
             @names = sort
                 {
                         $results->{$a}{$perl}{$field}
@@ -1336,7 +1336,7 @@ sub grind_print_compact {
     for my $test_name (@test_names) {
         my $doing_ave = ($test_name eq 'AVERAGE');
         my $res = $doing_ave ? $averages : $results->{$test_name};
-        $res = $res->{$perls->[$which_perl][0]};
+        $res = $res->{$perls->[$which_perl][1]};
 
         for my $field (@fields) {
             my $p = $res->{$field};