line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- mode: cperl -*- |
2
|
10
|
|
|
10
|
|
117949
|
use 5.008; |
|
9
|
|
|
|
|
27
|
|
3
|
9
|
|
|
9
|
|
36
|
use strict; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
135
|
|
4
|
9
|
|
|
9
|
|
18
|
use warnings; |
|
9
|
|
|
|
|
9
|
|
|
9
|
|
|
|
|
711
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Benchmark::Perl::Formance::Plugin::Mandelbrot; |
7
|
|
|
|
|
|
|
# git description: 9f757a9 |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:SCHWIGON'; |
10
|
|
|
|
|
|
|
# ABSTRACT: Benchmark::Perl::Formance plugin - more modern mandelbrot |
11
|
|
|
|
|
|
|
$Benchmark::Perl::Formance::Plugin::Mandelbrot::VERSION = '0.001'; |
12
|
|
|
|
|
|
|
our @default_subtests = qw( withmce withthreads ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub run |
15
|
|
|
|
|
|
|
{ |
16
|
9
|
|
|
9
|
1
|
9
|
my ($options) = @_; |
17
|
|
|
|
|
|
|
|
18
|
9
|
|
|
9
|
|
36
|
no strict "refs"; ## no critic |
|
9
|
|
|
|
|
9
|
|
|
9
|
|
|
|
|
1944
|
|
19
|
|
|
|
|
|
|
|
20
|
9
|
|
|
|
|
27
|
my %results = (); |
21
|
9
|
|
|
|
|
27
|
my $verbose = $options->{verbose}; |
22
|
9
|
|
|
|
|
9
|
my $subtests = $options->{subtests}; |
23
|
9
|
50
|
|
|
|
18
|
my @subtests = scalar(@{$subtests||[]}) ? @{$subtests||[]} : @default_subtests; |
|
9
|
0
|
|
|
|
54
|
|
|
0
|
50
|
|
|
|
0
|
|
24
|
|
|
|
|
|
|
|
25
|
9
|
|
|
|
|
27
|
for my $subtest (@subtests) |
26
|
|
|
|
|
|
|
{ |
27
|
10
|
50
|
|
|
|
33
|
print STDERR "# - $subtest...\n" if $options->{verbose} > 2; |
28
|
9
|
|
|
9
|
|
4320
|
eval "use ".__PACKAGE__."::$subtest"; ## no critic |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
162
|
|
|
10
|
|
|
|
|
833
|
|
29
|
10
|
100
|
|
|
|
1514
|
if ($@) { |
30
|
1
|
50
|
|
|
|
131
|
print STDERR "# Skip PerlStone plugin '$subtest'" if $verbose; |
31
|
1
|
50
|
|
|
|
7
|
print STDERR ":$@" if $verbose >= 2; |
32
|
1
|
50
|
|
|
|
73
|
print STDERR "\n" if $verbose; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
else { |
35
|
9
|
|
|
|
|
18
|
eval { |
36
|
9
|
|
|
|
|
36
|
my $main = __PACKAGE__."::$subtest"."::main"; |
37
|
9
|
|
|
|
|
36
|
$results{$subtest} = $main->($options); |
38
|
|
|
|
|
|
|
}; |
39
|
1
|
50
|
|
|
|
26
|
if ($@) { |
40
|
0
|
|
|
|
|
0
|
$results{$subtest} = { failed => $@ }; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
1
|
|
|
|
|
12
|
return \%results; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub main |
48
|
|
|
|
|
|
|
{ |
49
|
9
|
|
|
9
|
1
|
2133
|
my ($options) = @_; |
50
|
|
|
|
|
|
|
|
51
|
9
|
|
|
|
|
27
|
my $results = run($options); |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
8
|
return $results; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; # End of Benchmark::Perl::Formance::Plugin::PerlStone2015 |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |