Skip to content

Commit cd0727b

Browse files
committed
improve summary output
1 parent a39ce01 commit cd0727b

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ options to control number of threads, iterations, which benchmarks to run etc:
105105
--time, -t : Report time (sec) instead of score.
106106
--quick, -q : Quick benchmark run (implies -t).
107107
--no_mce : Do not run under MCE::Loop (implies -j 1).
108-
--scale <i>, -s <i> : Scale the bench workload by x times.
108+
--scale <i>, -s <i> : Scale the bench workload by x times (incompatible with -q).
109109
--skip_bio : Skip BioPerl benchmarks.
110110
--skip_prove : Skip Moose prove benchmark.
111111
--time_piece : Run optional Time::Piece benchmark (see benchmark details).

dkbench

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ See POD on the main module for info:
2727
--time, -t : Report time (sec) instead of score.
2828
--quick, -q : Quick benchmark run (implies -t).
2929
--no_mce : Do not run under MCE::Loop (implies -j 1).
30-
--scale <i>, -s <i> : Scale the bench workload by x times.
30+
--scale <i>, -s <i> : Scale the bench workload by x times (incompatible with -q).
3131
--skip_bio : Skip BioPerl benchmarks.
3232
--skip_prove : Skip Moose prove benchmark.
3333
--time_piece : Run optional Time::Piece benchmark (see benchmark details).
@@ -86,7 +86,7 @@ pod2usage({ -verbose => 1, -output => \*STDOUT, -noperldoc => 1}) if $opt{help};
8686

8787
$opt{iter} ||= 1;
8888
$opt{scale} ||= 1;
89-
$opt{time} = 1 if $opt{quick};
89+
($opt{time}, $opt{scale}) = (1, 1) if $opt{quick};
9090

9191
Benchmark::DKbench::Setup::fetch_genbank($opt{datapath}) if $opt{setup};
9292

lib/Benchmark/DKbench.pm

+10-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ options to control number of threads, iterations, which benchmarks to run etc:
149149
--time, -t : Report time (sec) instead of score.
150150
--quick, -q : Quick benchmark run (implies -t).
151151
--no_mce : Do not run under MCE::Loop (implies -j 1).
152-
--scale <i>, -s <i> : Scale the bench workload by x times.
152+
--scale <i>, -s <i> : Scale the bench workload by x times (incompatible with -q).
153153
--skip_bio : Skip BioPerl benchmarks.
154154
--skip_prove : Skip Moose prove benchmark.
155155
--time_piece : Run optional Time::Piece benchmark (see benchmark details).
@@ -477,7 +477,14 @@ sub calc_scalability {
477477
print (("-"x40)."\n");
478478
my $avg1 = min_max_avg($stats1->{total}->{$display});
479479
my $avg2 = min_max_avg($stats2->{total}->{$display});
480-
print "DKbench summary ($cnt benchmarks, $stats2->{threads} threads):\n";
480+
print "DKbench summary ($cnt benchmark";
481+
print "s" if $cnt > 1;
482+
print " x$opt->{scale} scale" if $opt->{scale} && $opt->{scale} > 1;
483+
print ", $opt->{iter} iterations" if $opt->{iter} && $opt->{iter} > 1;
484+
print ", $stats2->{threads} thread";
485+
print "s" if $stats2->{threads} > 1;
486+
print "):\n";
487+
$opt->{f} .= "s" if $opt->{time};
481488
print pad_to("Single:").sprintf($opt->{f}, $avg1)."\n";
482489
print pad_to("Multi:").sprintf($opt->{f}, $avg2)."\n";
483490
my @newperf = Benchmark::DKbench::drop_outliers(\@perf, -1);
@@ -1045,7 +1052,7 @@ sub total_stats {
10451052
my $benchmarks = benchmark_list();
10461053
my $display = $opt->{time} ? 'times' : 'scores';
10471054
my $title = $opt->{time} ? 'Time (sec)' : 'Score';
1048-
print "Aggregates:\n".pad_to("Benchmark",24).pad_to("Avg $title").pad_to("Min $title").pad_to("Max $title");
1055+
print "Aggregates ($opt->{iter} iterations):\n".pad_to("Benchmark",24).pad_to("Avg $title").pad_to("Min $title").pad_to("Max $title");
10491056
print pad_to("stdev %") if $opt->{stdev};
10501057
print pad_to("Pass %") unless $opt->{time};
10511058
print "\n";

t/simple.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ calc_scalability({}, \%stats1, \%stats2);
6767
}
6868
)
6969
};
70-
like($std[0], qr/Overall Avg Time/, 'Aggregate');
70+
like($std[0], qr/2 iterations\)/, 'Aggregate');
7171

7272
my $datadir = dist_dir("Benchmark-DKbench");
7373

0 commit comments

Comments
 (0)