blib/lib/Benchmark/Perl/Formance/Plugin/Shootout.pm

filter: Statementstmt 50.0% 18 / 36 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 2 totaltotal 40.3% 23 / 57 CC 8 SCAR 34.7
CC
8
Cov
38%
shootout
55.2
main
2.0
BEGIN
1.0
CRAP 32.0
« blib/lib/Benchmark/Perl/Formance.pm ↑ Summary blib/lib/Benchmark/Perl/Formance/Plugin/Shootout/regexdna.pm »
1 package Benchmark::Perl::Formance::Plugin::Shootout;
2 1 our $AUTHORITY = 'cpan:SCHWIGON';
3 # ABSTRACT: benchmark plugin - Shootout - Benchmark::Perl::Formance plugin covering Shootout code
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Benchmark ':hireswallclock';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 our $VERSION = "0.001";
12  
13 #############################################################
14 # #
15 # Benchmark Code ahead - Don't touch without strong reason! #
16 # #
17 #############################################################
18  
19 sub shootout
20 0 ▶{
Subroutine shootout: not called CC=8 SCAR=40.1
Pod undocumented
21 0 my ($options) = @_;
22  
23 1 ▶ no strict "refs"; ## no critic
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 0 my $verbose = $options->{verbose};
26 0 my %results = ();
27 #fannkuch
28 #knucleotide
29 #mandelbrot
30 0 for my $subtest (qw( binarytrees
31 fasta
32 nbody
33 pidigits
34 regexdna
35 revcomp
36 spectralnorm
37 ))
38 {
39 0 ▶ print STDERR "# - $subtest...\n" if $options->{verbose} > 2;
Branch: 1 branch
BranchTrueFalseTotal
if $options->{"verbose"} > 2 0 0 0
40 0 eval "use Benchmark::Perl::Formance::Plugin::Shootout::$subtest"; ## no critic
41 0 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) { } 0 0 0
42 0 ▶ print STDERR "# Skip Shootout plugin '$subtest'" if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
43 0 ▶ print STDERR ":$@" if $verbose >= 2;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose >= 2 0 0 0
44 0 ▶ print STDERR "\n" if $verbose;
Branch: 1 branch
BranchTrueFalseTotal
if $verbose 0 0 0
45 }
46 else {
47 0 eval {
48 0 my $main = __PACKAGE__."::$subtest"."::main";
49 0 $results{$subtest} = $main->($options);
50 };
51 0 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 0 0
52 0 $results{$subtest} = { failed => $@ };
53 }
54 }
55 }
56 0 return \%results;
57 }
58  
59 sub main
60 0 ▶{
Subroutine main: not called CC=1 SCAR=6.9
Pod undocumented
61 0 my ($options) = @_;
62  
63 0 return shootout($options);
64 }
65  
66 1 1; # End of Benchmark::Perl::Formance::Plugin::Shootout
67  
68 __END__
« blib/lib/Benchmark/Perl/Formance.pm ↑ Summary blib/lib/Benchmark/Perl/Formance/Plugin/Shootout/regexdna.pm »