Profile of /usr/local/lib/perl5/5.10.1/Test/Deep/Cmp.pm

← Index
NYTProf Performance Profile «block view•line view•sub view»
For 05.Domain_and_Item.t
Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:23:18 2010

File | /usr/local/lib/perl5/5.10.1/Test/Deep/Cmp.pm
Statements Executed | 208
Statement Execution Time | 2.11ms

Subroutines — ordered by exclusive time
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
32 | 5 | 4 | 1.06ms | 1.17ms | Test::Deep::Cmp::::new Test::Deep::Cmp::new
13 | 13 | 13 | 196µs | 225µs | Test::Deep::Cmp::::import Test::Deep::Cmp::import
13 | 1 | 2 | 29µs | 29µs | Test::Deep::Cmp::::CORE:match Test::Deep::Cmp::CORE:match (opcode)
1 | 1 | 1 | 26µs | 101µs | Test::Deep::Cmp::::BEGIN@7 Test::Deep::Cmp::BEGIN@7
7 | 4 | 4 | 23µs | 60µs | Test::Deep::Cmp::::data Test::Deep::Cmp::data
1 | 1 | 1 | 20µs | 24µs | Test::Deep::Ignore::::BEGIN@1Test::Deep::Ignore::BEGIN@1
1 | 1 | 1 | 12µs | 38µs | Test::Deep::Cmp::::BEGIN@20 Test::Deep::Cmp::BEGIN@20
1 | 1 | 1 | 12µs | 25µs | Test::Deep::Ignore::::BEGIN@2Test::Deep::Ignore::BEGIN@2
1 | 1 | 1 | 1µs | 1µs | Test::Deep::Cmp::::init Test::Deep::Cmp::init
0 | 0 | 0 | 0s | 0s | Test::Deep::Cmp::::cmp Test::Deep::Cmp::cmp
0 | 0 | 0 | 0s | 0s | Test::Deep::Cmp::::make_all Test::Deep::Cmp::make_all
0 | 0 | 0 | 0s | 0s | Test::Deep::Cmp::::make_any Test::Deep::Cmp::make_any
0 | 0 | 0 | 0s | 0s | Test::Deep::Cmp::::renderExp Test::Deep::Cmp::renderExp
0 | 0 | 0 | 0s | 0s | Test::Deep::Cmp::::renderGot Test::Deep::Cmp::renderGot
0 | 0 | 0 | 0s | 0s | Test::Deep::Cmp::::render_stack Test::Deep::Cmp::render_stack
0 | 0 | 0 | 0s | 0s | Test::Deep::Cmp::::reset_arrow Test::Deep::Cmp::reset_arrow
0 | 0 | 0 | 0s | 0s | Test::Deep::Cmp::::string Test::Deep::Cmp::string

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 | 3 | 45µs | 2 | 28µs | # spent 24µs (20+4) within Test::Deep::Ignore::BEGIN@1 which was called # once (20µs+4µs) by Test::Deep::Ignore::BEGIN@6 at line 1 use strict; # spent 24µs making 1 call to Test::Deep::Ignore::BEGIN@1 # spent 4µs making 1 call to strict::import
2 | 3 | 78µs | 2 | 38µs | # spent 25µs (12+13) within Test::Deep::Ignore::BEGIN@2 which was called # once (12µs+13µs) by Test::Deep::Ignore::BEGIN@6 at line 2 use warnings; # spent 25µs making 1 call to Test::Deep::Ignore::BEGIN@2 # spent 13µs making 1 call to warnings::import
3 |  |  |  |  |
4 |  |  |  |  | package Test::Deep::Cmp;
5 |  |  |  |  |
6 |  |  |  |  | use overload
7 | 1 | 23µs | 1 | 75µs | # spent 101µs (26+75) within Test::Deep::Cmp::BEGIN@7 which was called # once (26µs+75µs) by Test::Deep::Ignore::BEGIN@6 at line 11 '&' => \&make_all, # spent 75µs making 1 call to overload::import
8 |  |  |  |  | '|' => \&make_any,
9 |  |  |  |  | '""' => \&string,
10 |  |  |  |  | fallback => 1,
11 | 2 | 93µs | 1 | 101µs | ; # spent 101µs making 1 call to Test::Deep::Cmp::BEGIN@7
12 |  |  |  |  |
13 |  |  |  |  | sub import
14 |  |  |  |  | # spent 225µs (196+29) within Test::Deep::Cmp::import which was called 13 times, avg 17µs/call: # once (28µs+4µs) by Test::Deep::Ignore::BEGIN@6 at line 6 of Test/Deep/Ignore.pm # once (22µs+2µs) by Test::Deep::HashElements::BEGIN@6 at line 6 of Test/Deep/HashElements.pm # once (19µs+2µs) by Test::Deep::Shallow::BEGIN@6 at line 6 of Test/Deep/Shallow.pm # once (16µs+2µs) by Test::Deep::Hash::BEGIN@6 at line 6 of Test/Deep/Hash.pm # once (14µs+2µs) by Test::Deep::HashKeys::BEGIN@6 at line 6 of Test/Deep/HashKeys.pm # once (13µs+2µs) by Test::Deep::Ref::BEGIN@6 at line 6 of Test/Deep/Ref.pm # once (12µs+3µs) by Test::Deep::ArrayElementsOnly::BEGIN@6 at line 6 of Test/Deep/ArrayElementsOnly.pm # once (13µs+2µs) by Test::Deep::RefType::BEGIN@6 at line 6 of Test/Deep/RefType.pm # once (12µs+2µs) by Test::Deep::HashKeysOnly::BEGIN@6 at line 6 of Test/Deep/HashKeysOnly.pm # once (12µs+2µs) by Test::Deep::ArrayLength::BEGIN@6 at line 6 of Test/Deep/ArrayLength.pm # once (12µs+2µs) by Test::Deep::Blessed::BEGIN@6 at line 6 of Test/Deep/Blessed.pm # once (11µs+2µs) by Test::Deep::ArrayLengthOnly::BEGIN@6 at line 6 of Test/Deep/ArrayLengthOnly.pm # once (11µs+2µs) by Test::Deep::Array::BEGIN@6 at line 6 of Test/Deep/Array.pm {
15 | 13 | 8µs |  |  | my $pkg = shift;
16 |  |  |  |  |
17 | 13 | 6µs |  |  | my $callpkg = caller();
18 | 13 | 128µs | 13 | 29µs | if ($callpkg =~ /^Test::Deep::/) # spent 29µs making 13 calls to Test::Deep::Cmp::CORE:match, avg 2µs/call
19 |  |  |  |  | {
20 | 3 | 567µs | 2 | 64µs | # spent 38µs (12+26) within Test::Deep::Cmp::BEGIN@20 which was called # once (12µs+26µs) by Test::Deep::Ignore::BEGIN@6 at line 20 no strict 'refs'; # spent 38µs making 1 call to Test::Deep::Cmp::BEGIN@20 # spent 26µs making 1 call to strict::unimport
21 |  |  |  |  |
22 | 13 | 112µs |  |  | push @{$callpkg."::ISA"}, $pkg;
23 |  |  |  |  | }
24 |  |  |  |  | }
25 |  |  |  |  |
26 |  |  |  |  | sub new
27 |  |  |  |  | # spent 1.17ms (1.06+112µs) within Test::Deep::Cmp::new which was called 32 times, avg 37µs/call: # 25 times (680µs+55µs) by Test::Deep::__ANON__[/usr/local/lib/perl5/5.10.1/Test/Deep.pm:92] at line 91 of Test/Deep.pm, avg 29µs/call # 2 times (147µs+29µs) by Test::Deep::Hash::hash_keys at line 50 of Test/Deep/Hash.pm, avg 88µs/call # 2 times (79µs+23µs) by Test::Deep::HashKeys::hashkeysonly at line 37 of Test/Deep/HashKeys.pm, avg 51µs/call # 2 times (67µs+4µs) by Test::Deep::Hash::hash_elements at line 40 of Test/Deep/Hash.pm, avg 35µs/call # once (85µs+1µs) by Test::Deep::__ANON__[/usr/local/lib/perl5/5.10.1/Test/Deep.pm:92] at line 8 of Test/Deep/Ignore.pm {
28 | 32 | 11µs |  |  | my $pkg = shift;
29 |  |  |  |  |
30 | 32 | 888µs |  |  | my $self = bless {}, $pkg;
31 |  |  |  |  |
32 | 32 | 38µs | 32 | 112µs | $self->init(@_); # spent 29µs making 2 calls to Test::Deep::HashKeys::init, avg 14µs/call # spent 26µs making 13 calls to Test::Deep::Shallow::init, avg 2µs/call # spent 23µs making 2 calls to Test::Deep::HashKeysOnly::init, avg 12µs/call # spent 7µs making 2 calls to Test::Deep::Hash::init, avg 4µs/call # spent 7µs making 3 calls to Test::Deep::RefType::init, avg 2µs/call # spent 6µs making 3 calls to Test::Deep::Blessed::init, avg 2µs/call # spent 4µs making 2 calls to Test::Deep::HashElements::init, avg 2µs/call # spent 2µs making 1 call to Test::Deep::Array::init # spent 2µs making 1 call to Test::Deep::ArrayLength::init # spent 2µs making 1 call to Test::Deep::ArrayLengthOnly::init # spent 2µs making 1 call to Test::Deep::ArrayElementsOnly::init # spent 1µs making 1 call to Test::Deep::Cmp::init
33 | 32 | 70µs |  |  | return $self;
34 |  |  |  |  | }
35 |  |  |  |  |
36 |  |  |  |  | sub init
37 | 1 | 7µs |  |  | # spent 1µs within Test::Deep::Cmp::init which was called # once (1µs+0s) by Test::Deep::Cmp::new at line 32 {
38 |  |  |  |  | }
39 |  |  |  |  |
40 |  |  |  |  | sub make_all
41 |  |  |  |  | {
42 |  |  |  |  | my ($e1, $e2) = @_;
43 |  |  |  |  |
44 |  |  |  |  | if (UNIVERSAL::isa($e1, "Test::Deep::All"))
45 |  |  |  |  | {
46 |  |  |  |  | $e1->add($e2);
47 |  |  |  |  | return $e1;
48 |  |  |  |  | }
49 |  |  |  |  | elsif(UNIVERSAL::isa($e2, "Test::Deep::All"))
50 |  |  |  |  | {
51 |  |  |  |  | $e2->add($e1);
52 |  |  |  |  | return $e2;
53 |  |  |  |  | }
54 |  |  |  |  | else
55 |  |  |  |  | {
56 |  |  |  |  | return Test::Deep::all($e1, $e2);
57 |  |  |  |  | }
58 |  |  |  |  | }
59 |  |  |  |  |
60 |  |  |  |  | sub make_any
61 |  |  |  |  | {
62 |  |  |  |  | my ($e1, $e2) = @_;
63 |  |  |  |  |
64 |  |  |  |  | if (UNIVERSAL::isa($e1, "Test::Deep::Any"))
65 |  |  |  |  | {
66 |  |  |  |  | $e1->add($e2);
67 |  |  |  |  | return $e1;
68 |  |  |  |  | }
69 |  |  |  |  | elsif(UNIVERSAL::isa($e2, "Test::Deep::Any"))
70 |  |  |  |  | {
71 |  |  |  |  | $e2->add($e1);
72 |  |  |  |  | return $e2;
73 |  |  |  |  | }
74 |  |  |  |  | else
75 |  |  |  |  | {
76 |  |  |  |  | return Test::Deep::any($e1, $e2);
77 |  |  |  |  | }
78 |  |  |  |  | }
79 |  |  |  |  |
80 |  |  |  |  | sub cmp
81 |  |  |  |  | {
82 |  |  |  |  | my ($a1, $a2, $rev) = @_;
83 |  |  |  |  |
84 |  |  |  |  | ($a1, $a2) = ($a2, $a1) if $rev;
85 |  |  |  |  |
86 |  |  |  |  | return (overload::StrVal($a1) cmp overload::StrVal($a2));
87 |  |  |  |  | }
88 |  |  |  |  |
89 |  |  |  |  | sub string
90 |  |  |  |  | {
91 |  |  |  |  | my $self = shift;
92 |  |  |  |  |
93 |  |  |  |  | return overload::StrVal($self);
94 |  |  |  |  | }
95 |  |  |  |  |
96 |  |  |  |  | sub render_stack
97 |  |  |  |  | {
98 |  |  |  |  | my $self = shift;
99 |  |  |  |  | my $var = shift;
100 |  |  |  |  |
101 |  |  |  |  | return $var;
102 |  |  |  |  | }
103 |  |  |  |  |
104 |  |  |  |  | sub renderExp
105 |  |  |  |  | {
106 |  |  |  |  | my $self = shift;
107 |  |  |  |  |
108 |  |  |  |  | return $self->renderGot($self->{val});
109 |  |  |  |  | }
110 |  |  |  |  |
111 |  |  |  |  | sub renderGot
112 |  |  |  |  | {
113 |  |  |  |  | my $self = shift;
114 |  |  |  |  |
115 |  |  |  |  | return Test::Deep::render_val(@_);
116 |  |  |  |  | }
117 |  |  |  |  |
118 |  |  |  |  | sub reset_arrow
119 |  |  |  |  | {
120 |  |  |  |  | return 1;
121 |  |  |  |  | }
122 |  |  |  |  |
123 |  |  |  |  | sub data
124 |  |  |  |  | # spent 60µs (23+37) within Test::Deep::Cmp::data which was called 7 times, avg 9µs/call: # 2 times (8µs+12µs) by Test::Deep::Hash::descend at line 25 of Test/Deep/Hash.pm, avg 10µs/call # 2 times (6µs+13µs) by Test::Deep::HashKeysOnly::descend at line 23 of Test/Deep/HashKeysOnly.pm, avg 9µs/call # 2 times (5µs+8µs) by Test::Deep::HashElements::descend at line 25 of Test/Deep/HashElements.pm, avg 7µs/call # once (4µs+4µs) by Test::Deep::ArrayElementsOnly::descend at line 24 of Test/Deep/ArrayElementsOnly.pm {
125 | 7 | 1µs |  |  | my $self = shift;
126 |  |  |  |  |
127 | 7 | 29µs | 7 | 37µs | return $Test::Deep::Stack->getLast; # spent 37µs making 7 calls to Test::Deep::Stack::getLast, avg 5µs/call
128 |  |  |  |  | }
129 |  |  |  |  |
130 | 1 | 5µs |  |  | 1;
|  |  |  |  | # spent 29µs within Test::Deep::Cmp::CORE:match which was called 13 times, avg 2µs/call: # 13 times (29µs+0s) by Test::Deep::Cmp::import at line 18 of Test/Deep/Cmp.pm, avg 2µs/call sub Test::Deep::Cmp::CORE:match; # xsub