← Index
NYTProf Performance Profile   « block view • line view • sub view »
For t/app_dpath.t
  Run on Tue Jun 5 15:25:28 2012
Reported on Tue Jun 5 15:26:01 2012

Filename/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep/Cmp.pm
StatementsExecuted 683 statements in 12.4ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
144437.71ms11.1msTest::Deep::Cmp::::newTest::Deep::Cmp::new
121212809µs980µsTest::Deep::Cmp::::importTest::Deep::Cmp::import
2444467µs1.41msTest::Deep::Cmp::::dataTest::Deep::Cmp::data
1211171µs171µsTest::Deep::Cmp::::CORE:matchTest::Deep::Cmp::CORE:match (opcode)
11190µs377µsTest::Deep::Cmp::::BEGIN@7Test::Deep::Cmp::BEGIN@7
11161µs72µsTest::Deep::Ref::::BEGIN@1Test::Deep::Ref::BEGIN@1
11154µs216µsTest::Deep::Cmp::::BEGIN@12Test::Deep::Cmp::BEGIN@12
11139µs134µsTest::Deep::Cmp::::BEGIN@21Test::Deep::Cmp::BEGIN@21
11126µs47µsTest::Deep::Ref::::BEGIN@2Test::Deep::Ref::BEGIN@2
0000s0sTest::Deep::Cmp::::cmpTest::Deep::Cmp::cmp
0000s0sTest::Deep::Cmp::::initTest::Deep::Cmp::init
0000s0sTest::Deep::Cmp::::make_allTest::Deep::Cmp::make_all
0000s0sTest::Deep::Cmp::::make_anyTest::Deep::Cmp::make_any
0000s0sTest::Deep::Cmp::::renderExpTest::Deep::Cmp::renderExp
0000s0sTest::Deep::Cmp::::renderGotTest::Deep::Cmp::renderGot
0000s0sTest::Deep::Cmp::::render_stackTest::Deep::Cmp::render_stack
0000s0sTest::Deep::Cmp::::reset_arrowTest::Deep::Cmp::reset_arrow
0000s0sTest::Deep::Cmp::::stringTest::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
1290µs283µ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
use strict;
# spent 72µs making 1 call to Test::Deep::Ref::BEGIN@1 # spent 11µs making 1 call to strict::import
22242µs267µ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
use warnings;
# spent 47µs making 1 call to Test::Deep::Ref::BEGIN@2 # spent 21µs making 1 call to warnings::import
3
4package Test::Deep::Cmp;
5
6use overload
71287µ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
'&' => \&make_all,
# spent 287µs making 1 call to overload::import
8 '|' => \&make_any,
9 '""' => \&string,
10 fallback => 1,
112180µs1377µs;
# spent 377µs making 1 call to Test::Deep::Cmp::BEGIN@7
122332µs2378µ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
use Scalar::Util;
# spent 216µs making 1 call to Test::Deep::Cmp::BEGIN@12 # spent 162µs making 1 call to Exporter::import
13
14sub 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
{
16481.08ms my $pkg = shift;
17
18 my $callpkg = caller();
1912171µs if ($callpkg =~ /^Test::Deep::/)
# spent 171µs making 12 calls to Test::Deep::Cmp::CORE:match, avg 14µs/call
20 {
2122.12ms2230µ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
no strict 'refs';
# 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
27sub 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
{
295767.73ms my $pkg = shift;
30
31 my $self = bless {}, $pkg;
32
331443.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
37sub init
38{
39}
40
41sub 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
61sub 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
81sub 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
90sub string
91{
92 my $self = shift;
93
94 return overload::StrVal($self);
95}
96
97sub render_stack
98{
99 my $self = shift;
100 my $var = shift;
101
102 return $var;
103}
104
105sub renderExp
106{
107 my $self = shift;
108
109 return $self->renderGot($self->{val});
110}
111
112sub renderGot
113{
114 my $self = shift;
115
116 return Test::Deep::render_val(@_);
117}
118
119sub reset_arrow
120{
121 return 1;
122}
123
124sub 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
{
12648583µs my $self = shift;
127
12824944µs return $Test::Deep::Stack->getLast;
# spent 944µs making 24 calls to Test::Deep::Stack::getLast, avg 39µs/call
129}
130
131111µs1;
 
# 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
sub Test::Deep::Cmp::CORE:match; # opcode