Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add --show-relative analyze option, defaulting to --compare, turned o…
…ff for diagnosis
  • Loading branch information
Geoffrey Broadwell committed Nov 1, 2014
1 parent 80d904e commit 8fc4746
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
22 changes: 15 additions & 7 deletions analyze
Expand Up @@ -64,14 +64,16 @@ sub process_options_and_arguments {
'ignore-compile|ignore_compile|ignorecompile!',
'skip-incomplete|skip_incomplete|skipincomplete!',
'show-failures|show_failures|showfailures!',
'show-relative|show_relative|showrelative!',
'show-rates|show_rates|showrates!',
'compare!', 'history!')
or pod2usage(-verbose => 0);
pod2usage(-verbose => 1) if $opt{help};
pod2usage(-verbose => 2) if $opt{man};

$opt{'min-time'} //= 1e-2;
$opt{'show-rates'} //= 1;
$opt{'min-time'} //= 1e-2;
$opt{'show-rates'} //= 1;
$opt{'show-relative'} //= $opt{compare};

$opt{outfile} //= '-';
my $suffix = (fileparse($opt{outfile}, qr/\.[^.]+$/))[2] || '.';
Expand Down Expand Up @@ -478,7 +480,7 @@ sub summarize_results_text {
$output .= "\n";
}

if ($opt->{compare}) {
if ($opt->{'show-relative'}) {
$show_test_name->($test);
for my $comp (@comps) {
my $key = $comp->{key} || $comp->{name};
Expand Down Expand Up @@ -534,7 +536,7 @@ sub summarize_results_text {
}

my $scores = $data->{score};
if ($scores && $opt->{compare}) {
if ($scores && $opt->{'show-relative'}) {
$output .= ' ' x $longest_test . $spacer . '=' x length($titles) . "\n";
$output .= sprintf "%-${longest_test}s", 'SUMMARY SCORE';
for my $comp (@comps) {
Expand Down Expand Up @@ -1452,7 +1454,7 @@ analyze -- Analyze benchmark data produced by timeall
[--style=0|1|auto] [--outfile=path/to/file.ext]
[--min-time=0.01]
[--ignore-startup] [--ignore-compile] [--skip-incomplete]
[--show-rates] [--show-failures] [--verbose]
[--show-rates] [--show-relative] [--show-failures] [--verbose]
[--compare] [--history]
path/to/timing_file.json [path/to/second_timing_file.json ...]
Expand Down Expand Up @@ -1544,8 +1546,14 @@ at once, rather than analyzing each timing file individually.
=item --show-rates
Show actual benchmark processing rates as opposed to normalized scores
(or if --compare is on, in addition to). Defaults to on; use --no-show-rates
to turn this off.
(or if --show-relative is on, in addition to). Defaults to on; use
--no-show-rates to turn this off.
=item --show-relative
Show relative benchmark processing rates as opposed to actual values
(or if --show-rates is on, in addition to). Defaults to on if --compare
is set, and off otherwise; use --no-show-rates to turn this off.
=item --show-failures
Expand Down
3 changes: 2 additions & 1 deletion bench
Expand Up @@ -471,7 +471,8 @@ multi MAIN ('diagnose', *@timings, :$format?, :$style?, :$outfile?,
Bool :$skip-incomplete = True, Bool :$verbose?) {
needs-timings('diagnose failures');

my @options = as-options(:show-failures, :!show-rates, :$min-time,
my @options = as-options(:show-failures, :!show-rates, :!show-relative,
:compare, :$min-time,
:$ignore-startup, :$ignore-compile,
:$skip-incomplete, :$verbose,
:$format, :$style, :$outfile);
Expand Down

0 comments on commit 8fc4746

Please sign in to comment.