line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
13037
|
use v5.12; |
|
4
|
|
|
|
|
12
|
|
2
|
4
|
|
|
4
|
|
18
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
67
|
|
3
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
210
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
7
|
|
|
|
|
|
|
our $VERSION = '0.007'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use parent qw(Benchmark::Featureset::ParamCheck::Base); |
10
|
4
|
|
|
4
|
|
21
|
use Ref::Util::XS 0.116 qw(is_blessed_ref is_plain_hashref is_plain_arrayref is_ref); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
19
|
|
11
|
4
|
|
|
4
|
|
222
|
use namespace::autoclean; |
|
4
|
|
|
|
|
53
|
|
|
4
|
|
|
|
|
264
|
|
12
|
4
|
|
|
4
|
|
20
|
|
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
25
|
|
13
|
|
|
|
|
|
|
use constant long_name => 'Pure Perl Implementation with Ref::Util::XS'; |
14
|
4
|
|
|
4
|
|
215
|
use constant short_name => 'RefUtilXS'; |
|
4
|
|
|
|
|
27
|
|
|
4
|
|
|
|
|
181
|
|
15
|
4
|
|
|
4
|
|
18
|
|
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1891
|
|
16
|
|
|
|
|
|
|
state $check = sub { |
17
|
|
|
|
|
|
|
my %args = (@_==1 && ref($_[0]) eq 'HASH') ? %{$_[0]} : @_; |
18
|
|
|
|
|
|
|
die 'invalid key' if grep !/\A(integer|object|hashes)\z/, keys %args; |
19
|
1000018
|
100
|
66
|
1000018
|
|
2493306
|
|
|
1000009
|
|
|
|
|
2424136
|
|
20
|
1000018
|
100
|
|
|
|
3889911
|
die 'bad integer' unless |
21
|
|
|
|
|
|
|
defined($args{integer}) |
22
|
|
|
|
|
|
|
&& !is_ref($args{integer}) |
23
|
|
|
|
|
|
|
&& $args{integer} =~ /\A-?[0-9]+\z/; |
24
|
|
|
|
|
|
|
|
25
|
1000016
|
100
|
66
|
|
|
3697106
|
die 'bad object' unless |
|
|
|
100
|
|
|
|
|
26
|
|
|
|
|
|
|
is_blessed_ref($args{object}) |
27
|
|
|
|
|
|
|
&& $args{object}->can('print') |
28
|
|
|
|
|
|
|
&& $args{object}->can('close'); |
29
|
|
|
|
|
|
|
|
30
|
1000012
|
100
|
100
|
|
|
3920715
|
die 'bad hashes' unless |
|
|
|
66
|
|
|
|
|
31
|
|
|
|
|
|
|
is_plain_arrayref($args{hashes}); |
32
|
|
|
|
|
|
|
for my $arr (@{ $args{hashes} }) { |
33
|
1000008
|
100
|
|
|
|
1593495
|
die 'bad hashes' unless is_plain_hashref($arr); |
34
|
1000006
|
|
|
|
|
1095100
|
} |
|
1000006
|
|
|
|
|
1553073
|
|
35
|
5000026
|
100
|
|
|
|
7022143
|
|
36
|
|
|
|
|
|
|
\%args; |
37
|
|
|
|
|
|
|
}; |
38
|
1000004
|
|
|
|
|
2732965
|
} |
39
|
118
|
|
|
118
|
0
|
343
|
|
40
|
|
|
|
|
|
|
state $check = sub { |
41
|
|
|
|
|
|
|
die 'wrong number of parameters' unless @_==3; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
die 'bad integer' unless |
44
|
1000007
|
100
|
|
1000007
|
|
1435902
|
defined($_[0]) |
45
|
|
|
|
|
|
|
&& !is_ref($_[0]) |
46
|
1000005
|
100
|
33
|
|
|
3207729
|
&& $_[0] =~ /\A-?[0-9]+\z/; |
|
|
|
66
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
die 'bad object' unless |
49
|
|
|
|
|
|
|
is_blessed_ref($_[2]) |
50
|
|
|
|
|
|
|
&& $_[2]->can('print') |
51
|
1000004
|
100
|
66
|
|
|
3655653
|
&& $_[2]->can('close'); |
|
|
|
66
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
die 'bad hashes' unless |
54
|
|
|
|
|
|
|
is_plain_arrayref($_[1]); |
55
|
|
|
|
|
|
|
for my $arr (@{ $_[1] }) { |
56
|
1000003
|
50
|
|
|
|
1543713
|
die 'bad hashes' unless is_plain_hashref($arr); |
57
|
|
|
|
|
|
|
} |
58
|
1000003
|
|
|
|
|
1081065
|
|
|
1000003
|
|
|
|
|
1390166
|
|
59
|
5000013
|
100
|
|
|
|
7023923
|
@_; |
60
|
|
|
|
|
|
|
}; |
61
|
|
|
|
|
|
|
} |
62
|
1000002
|
|
|
|
|
2014048
|
|
63
|
107
|
|
|
107
|
0
|
283
|
1; |