@@ -48,6 +48,7 @@ sub process_options_and_arguments {
48
48
GetOptions(\%opt , ' help|h|?!' , ' man!' , ' format=s' , ' style=s' , ' outfile=s' ,
49
49
' ignore-startup|ignore_startup|ignorestartup!' ,
50
50
' ignore-compile|ignore_compile|ignorecompile!' ,
51
+ ' skip-incomplete|skip_incomplete|skipincomplete!' ,
51
52
' compare!' , ' history!' )
52
53
or pod2usage(-verbose => 0);
53
54
pod2usage(-verbose => 1) if $opt {help };
@@ -76,8 +77,10 @@ sub process_options_and_arguments {
76
77
sub analyze_timings_files {
77
78
my ($opt , $out_fh , @files ) = @_ ;
78
79
79
- my $ignore_startup = $opt -> {' ignore-startup' };
80
- my $ignore_compile = $opt -> {' ignore-compile' };
80
+ my $ignore_startup = $opt -> {' ignore-startup' };
81
+ my $ignore_compile = $opt -> {' ignore-compile' };
82
+ my $skip_incomplete = $opt -> {' skip-incomplete' };
83
+
81
84
my $analyze_timing_data = sub {
82
85
my $data = shift ;
83
86
my $startup = $data -> {run }{startup } || {};
@@ -87,7 +90,7 @@ sub analyze_timings_files {
87
90
$ignore_startup ,
88
91
$ignore_compile );
89
92
}
90
- $data -> {score } = compute_scores($data );
93
+ $data -> {score } = compute_scores($data , $skip_incomplete );
91
94
92
95
$opt -> {formatter }-> ($data , $opt , $out_fh );
93
96
};
@@ -261,7 +264,7 @@ sub compare_scaled_times {
261
264
# Compute overall 'score' by geometric mean of relative rates to
262
265
# a standard compiler serving as the reference 1.0 value.
263
266
sub compute_scores {
264
- my $data = shift ;
267
+ my ( $data , $skip_incomplete ) = @_ ;
265
268
my $tests = $data -> {times };
266
269
267
270
my @compilers = map { $_ -> {key } } @{$data -> {config }{compilers }};
@@ -270,11 +273,19 @@ sub compute_scores {
270
273
my %score ;
271
274
$score {$_ } = 1.0 for @compilers ;
272
275
273
- for my $test (@$tests ) {
276
+ TEST: for my $test (@$tests ) {
274
277
my $peak_rate = $test -> {compare }{peak_rate };
275
- my $reference = $peak_rate -> {$standard }{rate };
278
+
279
+ # Optionally skip any test that doesn't have a peak rate
280
+ # specified for every compiler being compared
281
+ if ($skip_incomplete ) {
282
+ for my $compiler (@compilers ) {
283
+ next TEST unless defined $peak_rate -> {$compiler }{rate };
284
+ }
285
+ }
276
286
277
287
# Can't compute scores at all if we lack a reference point
288
+ my $reference = $peak_rate -> {$standard }{rate };
278
289
return unless $reference ;
279
290
280
291
for my $compiler (@compilers ) {
@@ -456,8 +467,9 @@ sub summarize_results_text_history {
456
467
my $ignore = @ignore ? ' (ignoring ' . join (' and ' => @ignore ) . ' )' : ' ' ;
457
468
my $start = friendly_time($data -> {run }{start_time });
458
469
my $run_at = $opt -> {compare } ? ' ' : " run at $start " ;
470
+ my $skip = $opt -> {' skip-incomplete' } ? ' (skipping incomplete data)' : ' ' ;
459
471
my $output = " $CLEAR \n ==> perl6-bench version $data ->{run}{versions}{bench}$run_at$ignore \n " ;
460
- $output .= " --- showing HISTORICAL SCORES\n\n " ;
472
+ $output .= " --- showing HISTORICAL SCORES$skip \n\n " ;
461
473
$output .= sprintf $format , ' DATE' , @comp_names ;
462
474
463
475
# Put scores into columns by compiler name, allowing multiple scores
580
592
my $ignore = @ignore ? ' (ignoring ' . join(' and ' => @ignore) . ')' : '';
581
593
my $run_at = $opt- > {compare } ? '' : qq{ run at <span class ="bench _start _time ">} . friendly_time($data- > {run }{start _time }) . qq{</span >};
582
594
my $showing = 'showing ' . english_list(@{$s- >{showing }});
583
- $showing =~ s/\( (. + ?)\) /(<strong > $1<\/ strong > )/g;
595
+ $showing =~ s/\( (\S + ?)\) /(<strong > $1<\/ strong > )/g;
584
596
585
597
$html .= qq{<table class ="bench _summary " cellspacing ="0" cellpadding ="0">\n };
586
598
$html .= qq{<caption >perl 6-bench version <span class ="bench _ver ">$data- >{run }{versions }{bench }</span > $run_at$ignore<br > $showing</caption > \n };
@@ -1100,7 +1112,7 @@ analyze -- Analyze benchmark data produced by timeall
1100
1112
analyze [--help |-h |-?] [--man ]
1101
1113
[--format = text|json|html|html_snippet|html_plot ]
1102
1114
[--style = 0|1|auto ] [--outfile = path/to/file.ext ]
1103
- [--ignore-startup ] [--ignore-compile ]
1115
+ [--ignore-startup ] [--ignore-compile ] [ --skip-incomplete ]
1104
1116
[--compare ] [--history ]
1105
1117
path/to/timing_file.json [path/to/second_timing_file.json ...]
1106
1118
@@ -1168,6 +1180,15 @@ itself from each benchmark result, so that runtime performance can be
1168
1180
compared more directly. Only works for scalable tests, because it uses
1169
1181
runtime at C<SCALE = 0> as a portable proxy for true compile time .
1170
1182
1183
+ =item --skip-incomplete
1184
+
1185
+ When computing summary scores, skip any incomplete test data (tests that
1186
+ have timing data for some compilers but not others). This enables summary
1187
+ comparison of compilers that can't all complete every test. This can occur
1188
+ because of bugs, old versions of compilers that don't support current syntax,
1189
+ or compilers/languages that lack certain language features (NQP being the
1190
+ most common example of this).
1191
+
1171
1192
=item --compare
1172
1193
1173
1194
When processing multiple timing files, compare times across all timing files
0 commit comments