Filename | /home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep/Cmp.pm |
Statements | Executed 683 statements in 12.4ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
144 | 4 | 3 | 7.71ms | 11.1ms | new | Test::Deep::Cmp::
12 | 12 | 12 | 809µs | 980µs | import | Test::Deep::Cmp::
24 | 4 | 4 | 467µs | 1.41ms | data | Test::Deep::Cmp::
12 | 1 | 1 | 171µs | 171µs | CORE:match (opcode) | Test::Deep::Cmp::
1 | 1 | 1 | 90µs | 377µs | BEGIN@7 | Test::Deep::Cmp::
1 | 1 | 1 | 61µs | 72µs | BEGIN@1 | Test::Deep::Ref::
1 | 1 | 1 | 54µs | 216µs | BEGIN@12 | Test::Deep::Cmp::
1 | 1 | 1 | 39µs | 134µs | BEGIN@21 | Test::Deep::Cmp::
1 | 1 | 1 | 26µs | 47µs | BEGIN@2 | Test::Deep::Ref::
0 | 0 | 0 | 0s | 0s | cmp | Test::Deep::Cmp::
0 | 0 | 0 | 0s | 0s | init | Test::Deep::Cmp::
0 | 0 | 0 | 0s | 0s | make_all | Test::Deep::Cmp::
0 | 0 | 0 | 0s | 0s | make_any | Test::Deep::Cmp::
0 | 0 | 0 | 0s | 0s | renderExp | Test::Deep::Cmp::
0 | 0 | 0 | 0s | 0s | renderGot | Test::Deep::Cmp::
0 | 0 | 0 | 0s | 0s | render_stack | Test::Deep::Cmp::
0 | 0 | 0 | 0s | 0s | reset_arrow | Test::Deep::Cmp::
0 | 0 | 0 | 0s | 0s | string | Test::Deep::Cmp::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 90µs | 2 | 83µs | # spent 72µs (61+11) within Test::Deep::Ref::BEGIN@1 which was called:
# once (61µs+11µs) by Test::Deep::Ref::BEGIN@6 at line 1 # spent 72µs making 1 call to Test::Deep::Ref::BEGIN@1
# spent 11µs making 1 call to strict::import |
2 | 2 | 242µs | 2 | 67µs | # spent 47µs (26+21) within Test::Deep::Ref::BEGIN@2 which was called:
# once (26µs+21µs) by Test::Deep::Ref::BEGIN@6 at line 2 # spent 47µs making 1 call to Test::Deep::Ref::BEGIN@2
# spent 21µs making 1 call to warnings::import |
3 | |||||
4 | package Test::Deep::Cmp; | ||||
5 | |||||
6 | use overload | ||||
7 | 1 | 287µs | # spent 377µs (90+287) within Test::Deep::Cmp::BEGIN@7 which was called:
# once (90µs+287µs) by Test::Deep::Ref::BEGIN@6 at line 11 # spent 287µs making 1 call to overload::import | ||
8 | '|' => \&make_any, | ||||
9 | '""' => \&string, | ||||
10 | fallback => 1, | ||||
11 | 2 | 180µs | 1 | 377µs | ; # spent 377µs making 1 call to Test::Deep::Cmp::BEGIN@7 |
12 | 2 | 332µs | 2 | 378µs | # spent 216µs (54+162) within Test::Deep::Cmp::BEGIN@12 which was called:
# once (54µs+162µs) by Test::Deep::Ref::BEGIN@6 at line 12 # spent 216µs making 1 call to Test::Deep::Cmp::BEGIN@12
# spent 162µs making 1 call to Exporter::import |
13 | |||||
14 | sub import | ||||
15 | # spent 980µs (809+171) within Test::Deep::Cmp::import which was called 12 times, avg 82µs/call:
# once (130µs+25µs) by Test::Deep::Hash::BEGIN@6 at line 6 of Test/Deep/Hash.pm
# once (84µs+15µs) by Test::Deep::Ref::BEGIN@6 at line 6 of Test/Deep/Ref.pm
# once (60µs+23µs) by Test::Deep::Shallow::BEGIN@6 at line 6 of Test/Deep/Shallow.pm
# once (70µs+12µs) by Test::Deep::ArrayElementsOnly::BEGIN@6 at line 6 of Test/Deep/ArrayElementsOnly.pm
# once (70µs+11µs) by Test::Deep::ArrayLength::BEGIN@6 at line 6 of Test/Deep/ArrayLength.pm
# once (63µs+14µs) by Test::Deep::HashElements::BEGIN@6 at line 6 of Test/Deep/HashElements.pm
# once (60µs+14µs) by Test::Deep::HashKeysOnly::BEGIN@6 at line 6 of Test/Deep/HashKeysOnly.pm
# once (59µs+13µs) by Test::Deep::HashKeys::BEGIN@6 at line 6 of Test/Deep/HashKeys.pm
# once (58µs+11µs) by Test::Deep::ArrayLengthOnly::BEGIN@6 at line 6 of Test/Deep/ArrayLengthOnly.pm
# once (53µs+14µs) by Test::Deep::Blessed::BEGIN@6 at line 6 of Test/Deep/Blessed.pm
# once (54µs+12µs) by Test::Deep::RefType::BEGIN@6 at line 6 of Test/Deep/RefType.pm
# once (50µs+8µs) by Test::Deep::Array::BEGIN@6 at line 6 of Test/Deep/Array.pm | ||||
16 | 48 | 1.08ms | my $pkg = shift; | ||
17 | |||||
18 | my $callpkg = caller(); | ||||
19 | 12 | 171µs | if ($callpkg =~ /^Test::Deep::/) # spent 171µs making 12 calls to Test::Deep::Cmp::CORE:match, avg 14µs/call | ||
20 | { | ||||
21 | 2 | 2.12ms | 2 | 230µs | # spent 134µs (39+96) within Test::Deep::Cmp::BEGIN@21 which was called:
# once (39µs+96µs) by Test::Deep::Ref::BEGIN@6 at line 21 # spent 134µs making 1 call to Test::Deep::Cmp::BEGIN@21
# spent 95µs making 1 call to strict::unimport |
22 | |||||
23 | push @{$callpkg."::ISA"}, $pkg; | ||||
24 | } | ||||
25 | } | ||||
26 | |||||
27 | sub new | ||||
28 | # spent 11.1ms (7.71+3.41) within Test::Deep::Cmp::new which was called 144 times, avg 77µs/call:
# 135 times (6.74ms+3.06ms) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep.pm:80] at line 79 of Test/Deep.pm, avg 73µs/call
# 3 times (312µs+182µs) by Test::Deep::Hash::hash_keys at line 50 of Test/Deep/Hash.pm, avg 165µs/call
# 3 times (317µs+127µs) by Test::Deep::HashKeys::hashkeysonly at line 37 of Test/Deep/HashKeys.pm, avg 148µs/call
# 3 times (335µs+44µs) by Test::Deep::Hash::hash_elements at line 40 of Test/Deep/Hash.pm, avg 126µs/call | ||||
29 | 576 | 7.73ms | my $pkg = shift; | ||
30 | |||||
31 | my $self = bless {}, $pkg; | ||||
32 | |||||
33 | 144 | 3.41ms | $self->init(@_); # spent 779µs making 36 calls to Test::Deep::Shallow::init, avg 22µs/call
# spent 495µs making 15 calls to Test::Deep::Array::init, avg 33µs/call
# spent 439µs making 18 calls to Test::Deep::RefType::init, avg 24µs/call
# spent 398µs making 18 calls to Test::Deep::Blessed::init, avg 22µs/call
# spent 349µs making 15 calls to Test::Deep::ArrayLength::init, avg 23µs/call
# spent 266µs making 15 calls to Test::Deep::ArrayElementsOnly::init, avg 18µs/call
# spent 249µs making 15 calls to Test::Deep::ArrayLengthOnly::init, avg 17µs/call
# spent 182µs making 3 calls to Test::Deep::HashKeys::init, avg 61µs/call
# spent 127µs making 3 calls to Test::Deep::HashKeysOnly::init, avg 42µs/call
# spent 85µs making 3 calls to Test::Deep::Hash::init, avg 28µs/call
# spent 44µs making 3 calls to Test::Deep::HashElements::init, avg 15µs/call | ||
34 | return $self; | ||||
35 | } | ||||
36 | |||||
37 | sub init | ||||
38 | { | ||||
39 | } | ||||
40 | |||||
41 | sub make_all | ||||
42 | { | ||||
43 | my ($e1, $e2) = @_; | ||||
44 | |||||
45 | if (Scalar::Util::blessed($e1) and $e1->isa("Test::Deep::All")) | ||||
46 | { | ||||
47 | $e1->add($e2); | ||||
48 | return $e1; | ||||
49 | } | ||||
50 | elsif(Scalar::Util::blessed($e2) and $e2->isa("Test::Deep::All")) | ||||
51 | { | ||||
52 | $e2->add($e1); | ||||
53 | return $e2; | ||||
54 | } | ||||
55 | else | ||||
56 | { | ||||
57 | return Test::Deep::all($e1, $e2); | ||||
58 | } | ||||
59 | } | ||||
60 | |||||
61 | sub make_any | ||||
62 | { | ||||
63 | my ($e1, $e2) = @_; | ||||
64 | |||||
65 | if (Scalar::Util::blessed($e1) and $e1->isa("Test::Deep::Any")) | ||||
66 | { | ||||
67 | $e1->add($e2); | ||||
68 | return $e1; | ||||
69 | } | ||||
70 | elsif(Scalar::Util::blessed($e2) and $e2->isa("Test::Deep::Any")) | ||||
71 | { | ||||
72 | $e2->add($e1); | ||||
73 | return $e2; | ||||
74 | } | ||||
75 | else | ||||
76 | { | ||||
77 | return Test::Deep::any($e1, $e2); | ||||
78 | } | ||||
79 | } | ||||
80 | |||||
81 | sub cmp | ||||
82 | { | ||||
83 | my ($a1, $a2, $rev) = @_; | ||||
84 | |||||
85 | ($a1, $a2) = ($a2, $a1) if $rev; | ||||
86 | |||||
87 | return (overload::StrVal($a1) cmp overload::StrVal($a2)); | ||||
88 | } | ||||
89 | |||||
90 | sub string | ||||
91 | { | ||||
92 | my $self = shift; | ||||
93 | |||||
94 | return overload::StrVal($self); | ||||
95 | } | ||||
96 | |||||
97 | sub render_stack | ||||
98 | { | ||||
99 | my $self = shift; | ||||
100 | my $var = shift; | ||||
101 | |||||
102 | return $var; | ||||
103 | } | ||||
104 | |||||
105 | sub renderExp | ||||
106 | { | ||||
107 | my $self = shift; | ||||
108 | |||||
109 | return $self->renderGot($self->{val}); | ||||
110 | } | ||||
111 | |||||
112 | sub renderGot | ||||
113 | { | ||||
114 | my $self = shift; | ||||
115 | |||||
116 | return Test::Deep::render_val(@_); | ||||
117 | } | ||||
118 | |||||
119 | sub reset_arrow | ||||
120 | { | ||||
121 | return 1; | ||||
122 | } | ||||
123 | |||||
124 | sub data | ||||
125 | # spent 1.41ms (467µs+944µs) within Test::Deep::Cmp::data which was called 24 times, avg 59µs/call:
# 15 times (309µs+623µs) by Test::Deep::ArrayElementsOnly::descend at line 24 of Test/Deep/ArrayElementsOnly.pm, avg 62µs/call
# 3 times (78µs+186µs) by Test::Deep::Hash::descend at line 25 of Test/Deep/Hash.pm, avg 88µs/call
# 3 times (41µs+72µs) by Test::Deep::HashKeysOnly::descend at line 23 of Test/Deep/HashKeysOnly.pm, avg 38µs/call
# 3 times (38µs+63µs) by Test::Deep::HashElements::descend at line 25 of Test/Deep/HashElements.pm, avg 34µs/call | ||||
126 | 48 | 583µs | my $self = shift; | ||
127 | |||||
128 | 24 | 944µs | return $Test::Deep::Stack->getLast; # spent 944µs making 24 calls to Test::Deep::Stack::getLast, avg 39µs/call | ||
129 | } | ||||
130 | |||||
131 | 1 | 11µs | 1; | ||
# spent 171µs within Test::Deep::Cmp::CORE:match which was called 12 times, avg 14µs/call:
# 12 times (171µs+0s) by Test::Deep::Cmp::import at line 19, avg 14µs/call |