← 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:22:47 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
32541.06ms1.17msTest::Deep::Cmp::::new Test::Deep::Cmp::new
131313196µs225µsTest::Deep::Cmp::::import Test::Deep::Cmp::import
131229µs29µsTest::Deep::Cmp::::CORE:match Test::Deep::Cmp::CORE:match (opcode)
11126µs101µsTest::Deep::Cmp::::BEGIN@7 Test::Deep::Cmp::BEGIN@7
74423µs60µsTest::Deep::Cmp::::data Test::Deep::Cmp::data
11120µs24µsTest::Deep::Ignore::::BEGIN@1Test::Deep::Ignore::BEGIN@1
11112µs38µsTest::Deep::Cmp::::BEGIN@20 Test::Deep::Cmp::BEGIN@20
11112µs25µsTest::Deep::Ignore::::BEGIN@2Test::Deep::Ignore::BEGIN@2
1111µs1µsTest::Deep::Cmp::::init Test::Deep::Cmp::init
0000s0sTest::Deep::Cmp::::cmp Test::Deep::Cmp::cmp
0000s0sTest::Deep::Cmp::::make_all Test::Deep::Cmp::make_all
0000s0sTest::Deep::Cmp::::make_any Test::Deep::Cmp::make_any
0000s0sTest::Deep::Cmp::::renderExp Test::Deep::Cmp::renderExp
0000s0sTest::Deep::Cmp::::renderGot Test::Deep::Cmp::renderGot
0000s0sTest::Deep::Cmp::::render_stack Test::Deep::Cmp::render_stack
0000s0sTest::Deep::Cmp::::reset_arrow Test::Deep::Cmp::reset_arrow
0000s0sTest::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
1345µs228µ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
2378µs238µ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
4package Test::Deep::Cmp;
5
6use overload
7
# 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,
113116µs1101µs;
# spent 101µs making 1 call to Test::Deep::Cmp::BEGIN@7
12
13sub 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
{
1539142µs my $pkg = shift;
16
17 my $callpkg = caller();
1813112µs1329µs if ($callpkg =~ /^Test::Deep::/)
# spent 29µs making 13 calls to Test::Deep::Cmp::CORE:match, avg 2µs/call
19 {
203567µs264µ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 push @{$callpkg."::ISA"}, $pkg;
23 }
24}
25
26sub 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
{
281281.01ms my $pkg = shift;
29
30 my $self = bless {}, $pkg;
31
32 $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 return $self;
34}
35
36sub init
3717µ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
40sub 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
60sub 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
80sub 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
89sub string
90{
91 my $self = shift;
92
93 return overload::StrVal($self);
94}
95
96sub render_stack
97{
98 my $self = shift;
99 my $var = shift;
100
101 return $var;
102}
103
104sub renderExp
105{
106 my $self = shift;
107
108 return $self->renderGot($self->{val});
109}
110
111sub renderGot
112{
113 my $self = shift;
114
115 return Test::Deep::render_val(@_);
116}
117
118sub reset_arrow
119{
120 return 1;
121}
122
123sub 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
{
1251431µs my $self = shift;
126
127 return $Test::Deep::Stack->getLast;
# spent 37µs making 7 calls to Test::Deep::Stack::getLast, avg 5µs/call
128}
129
13015µs1;
# 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