← Index
NYTProf Performance Profile   « line view »
For t/optimization.t
  Run on Thu Jan 8 22:47:42 2015
Reported on Thu Jan 8 22:48:06 2015

Filename/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep/Cmp.pm
StatementsExecuted 135 statements in 9.72ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
9997.71ms7.73msTest::Deep::Cmp::::importTest::Deep::Cmp::import
18531.30ms1.49msTest::Deep::Cmp::::newTest::Deep::Cmp::new
84435µs89µsTest::Deep::Cmp::::dataTest::Deep::Cmp::data
11124µs68µsTest::Deep::Cmp::::BEGIN@7Test::Deep::Cmp::BEGIN@7
91121µs21µsTest::Deep::Cmp::::CORE:matchTest::Deep::Cmp::CORE:match (opcode)
11113µs28µsTest::Deep::Set::::BEGIN@1Test::Deep::Set::BEGIN@1
11113µs35µsTest::Deep::Cmp::::BEGIN@12Test::Deep::Cmp::BEGIN@12
11110µs14µsTest::Deep::Set::::BEGIN@2Test::Deep::Set::BEGIN@2
1119µs23µsTest::Deep::Cmp::::BEGIN@21Test::Deep::Cmp::BEGIN@21
2113µs3µsTest::Deep::Set::::CORE:sortTest::Deep::Set::CORE:sort (opcode)
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
1229µs242µs
# spent 28µs (13+14) within Test::Deep::Set::BEGIN@1 which was called: # once (13µs+14µs) by Test::Deep::Set::BEGIN@6 at line 1
use strict;
# spent 28µs making 1 call to Test::Deep::Set::BEGIN@1 # spent 14µs making 1 call to strict::import
2260µs219µs
# spent 14µs (10+5) within Test::Deep::Set::BEGIN@2 which was called: # once (10µs+5µs) by Test::Deep::Set::BEGIN@6 at line 2
use warnings;
# spent 14µs making 1 call to Test::Deep::Set::BEGIN@2 # spent 5µs making 1 call to warnings::import
3
4package Test::Deep::Cmp;
5
6use overload
7122µs144µs
# spent 68µs (24+44) within Test::Deep::Cmp::BEGIN@7 which was called: # once (24µs+44µs) by Test::Deep::Set::BEGIN@6 at line 11
'&' => \&make_all,
# spent 44µs making 1 call to overload::import
8 '|' => \&make_any,
9 '""' => \&string,
10 fallback => 1,
11120µs168µs;
# spent 68µs making 1 call to Test::Deep::Cmp::BEGIN@7
12272µs256µs
# spent 35µs (13+22) within Test::Deep::Cmp::BEGIN@12 which was called: # once (13µs+22µs) by Test::Deep::Set::BEGIN@6 at line 12
use Scalar::Util;
# spent 35µs making 1 call to Test::Deep::Cmp::BEGIN@12 # spent 22µs making 1 call to Exporter::import
13
14sub import
15
# spent 7.73ms (7.71+21µs) within Test::Deep::Cmp::import which was called 9 times, avg 859µs/call: # once (7.59ms+2µs) by Test::Deep::HashElements::BEGIN@6 at line 6 of Test/Deep/HashElements.pm # once (22µs+3µs) by Test::Deep::HashKeysOnly::BEGIN@6 at line 6 of Test/Deep/HashKeysOnly.pm # once (20µs+2µs) by Test::Deep::Set::BEGIN@6 at line 6 of Test/Deep/Set.pm # once (16µs+2µs) by Test::Deep::Ref::BEGIN@6 at line 6 of Test/Deep/Ref.pm # once (16µs+2µs) by Test::Deep::HashKeys::BEGIN@6 at line 6 of Test/Deep/HashKeys.pm # once (14µs+3µs) by Test::Deep::Blessed::BEGIN@6 at line 6 of Test/Deep/Blessed.pm # once (15µs+2µs) by Test::Deep::Hash::BEGIN@6 at line 6 of Test/Deep/Hash.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::Shallow::BEGIN@6 at line 6 of Test/Deep/Shallow.pm
{
1695µs my $pkg = shift;
17
1897µs my $callpkg = caller();
1997.67ms921µs if ($callpkg =~ /^Test::Deep::/)
# spent 21µs making 9 calls to Test::Deep::Cmp::CORE:match, avg 2µs/call
20 {
212432µs236µs
# spent 23µs (9+14) within Test::Deep::Cmp::BEGIN@21 which was called: # once (9µs+14µs) by Test::Deep::Set::BEGIN@6 at line 21
no strict 'refs';
# spent 23µs making 1 call to Test::Deep::Cmp::BEGIN@21 # spent 14µs making 1 call to strict::unimport
22
23988µs push @{$callpkg."::ISA"}, $pkg;
24 }
25}
26
27sub new
28
# spent 1.49ms (1.30+195µs) within Test::Deep::Cmp::new which was called 18 times, avg 83µs/call: # 10 times (564µs+33µs) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep.pm:81] at line 80 of Test/Deep.pm, avg 60µs/call # 2 times (210µs+54µs) by Test::Deep::HashKeys::hashkeysonly at line 37 of Test/Deep/HashKeys.pm, avg 132µs/call # 2 times (207µs+47µs) by Test::Deep::Hash::hash_keys at line 50 of Test/Deep/Hash.pm, avg 127µs/call # 2 times (156µs+55µs) by Test::Deep::bag at line 495 of Test/Deep.pm, avg 106µs/call # 2 times (159µs+7µs) by Test::Deep::Hash::hash_elements at line 40 of Test/Deep/Hash.pm, avg 83µs/call
{
29188µs my $pkg = shift;
30
31181.17ms my $self = bless {}, $pkg;
32
331840µs18195µs $self->init(@_);
# spent 55µs making 2 calls to Test::Deep::Set::init, avg 28µs/call # spent 54µs making 2 calls to Test::Deep::HashKeysOnly::init, avg 27µs/call # spent 47µs making 2 calls to Test::Deep::HashKeys::init, avg 23µs/call # spent 12µs making 4 calls to Test::Deep::Shallow::init, avg 3µs/call # spent 9µs making 2 calls to Test::Deep::Hash::init, avg 4µs/call # spent 7µs making 2 calls to Test::Deep::HashElements::init, avg 3µs/call # spent 6µs making 2 calls to Test::Deep::Blessed::init, avg 3µs/call # spent 6µs making 2 calls to Test::Deep::RefType::init, avg 3µs/call
341859µs 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 89µs (35+54) within Test::Deep::Cmp::data which was called 8 times, avg 11µs/call: # 2 times (14µs+19µs) by Test::Deep::Set::descend at line 29 of Test/Deep/Set.pm, avg 16µs/call # 2 times (8µs+14µs) by Test::Deep::Hash::descend at line 25 of Test/Deep/Hash.pm, avg 12µs/call # 2 times (6µs+10µs) by Test::Deep::HashKeysOnly::descend at line 23 of Test/Deep/HashKeysOnly.pm, avg 8µs/call # 2 times (7µs+10µs) by Test::Deep::HashElements::descend at line 25 of Test/Deep/HashElements.pm, avg 8µs/call
{
12683µs my $self = shift;
127
128837µs854µs return $Test::Deep::Stack->getLast;
# spent 54µs making 8 calls to Test::Deep::Stack::getLast, avg 7µs/call
129}
130
13112µs1;
 
# spent 21µs within Test::Deep::Cmp::CORE:match which was called 9 times, avg 2µs/call: # 9 times (21µs+0s) by Test::Deep::Cmp::import at line 19, avg 2µs/call
sub Test::Deep::Cmp::CORE:match; # opcode
# spent 3µs within Test::Deep::Set::CORE:sort which was called 2 times, avg 1µs/call: # 2 times (3µs+0s) by Test::Deep::Set::add at line 151 of Test/Deep/Set.pm, avg 1µs/call
sub Test::Deep::Set::CORE:sort; # opcode