← 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:02 2012

Filename/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep/HashElements.pm
StatementsExecuted 62 statements in 2.30ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
311244µs422µsTest::Deep::HashElements::::descend Test::Deep::HashElements::descend
11166µs83µsTest::Deep::Hash::::BEGIN@1.23 Test::Deep::Hash::BEGIN@1.23
31144µs44µsTest::Deep::HashElements::::init Test::Deep::HashElements::init
11143µs119µsTest::Deep::HashElements::::BEGIN@6 Test::Deep::HashElements::BEGIN@6
31139µs39µsTest::Deep::HashElements::::getMaster Test::Deep::HashElements::getMaster
11136µs353µsTest::Deep::SuperHashElements::::BEGIN@70Test::Deep::SuperHashElements::BEGIN@70
11133µs62µsTest::Deep::Hash::::BEGIN@2.24 Test::Deep::Hash::BEGIN@2.24
11129µs288µsTest::Deep::SubHashElements::::BEGIN@83 Test::Deep::SubHashElements::BEGIN@83
0000s0sTest::Deep::HashElements::::render_stack Test::Deep::HashElements::render_stack
0000s0sTest::Deep::HashElements::::reset_arrow Test::Deep::HashElements::reset_arrow
0000s0sTest::Deep::SubHashElements::::getMaster Test::Deep::SubHashElements::getMaster
0000s0sTest::Deep::SuperHashElements::::getMasterTest::Deep::SuperHashElements::getMaster
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
12113µs2101µs
# spent 83µs (66+17) within Test::Deep::Hash::BEGIN@1.23 which was called: # once (66µs+17µs) by Test::Deep::Hash::hash_elements at line 1
use strict;
# spent 83µs making 1 call to Test::Deep::Hash::BEGIN@1.23 # spent 17µs making 1 call to strict::import
22126µs290µs
# spent 62µs (33+28) within Test::Deep::Hash::BEGIN@2.24 which was called: # once (33µs+28µs) by Test::Deep::Hash::hash_elements at line 2
use warnings;
# spent 62µs making 1 call to Test::Deep::Hash::BEGIN@2.24 # spent 28µs making 1 call to warnings::import
3
4package Test::Deep::HashElements;
5
621.24ms2195µs
# spent 119µs (43+76) within Test::Deep::HashElements::BEGIN@6 which was called: # once (43µs+76µs) by Test::Deep::Hash::hash_elements at line 6
use Test::Deep::Ref;
# spent 119µs making 1 call to Test::Deep::HashElements::BEGIN@6 # spent 76µs making 1 call to Test::Deep::Cmp::import
7
8sub init
9
# spent 44µs within Test::Deep::HashElements::init which was called 3 times, avg 15µs/call: # 3 times (44µs+0s) by Test::Deep::Cmp::new at line 33 of Test/Deep/Cmp.pm, avg 15µs/call
{
10970µs my $self = shift;
11
12 my $val = shift;
13
14 $self->{val} = $val;
15}
16
17sub descend
18
# spent 422µs (244+178) within Test::Deep::HashElements::descend which was called 3 times, avg 141µs/call: # 3 times (244µs+178µs) by Test::Deep::descend at line 328 of Test/Deep.pm, avg 141µs/call
{
1933206µs my $self = shift;
20
21 my $got = shift;
22
23 my $exp = $self->{val};
24
253101µs my $data = $self->data;
# spent 101µs making 3 calls to Test::Deep::Cmp::data, avg 34µs/call
26
27339µs my $master = $self->getMaster($got, $exp);
# spent 39µs making 3 calls to Test::Deep::HashElements::getMaster, avg 13µs/call
28
29 foreach my $key (keys %$master)
30 {
31 $data->{index} = $key;
32
33 my $got_elem = exists $got->{$key} ? $got->{$key} : $Test::Deep::DNE;
34 my $exp_elem = exists $exp->{$key} ? $exp->{$key} : $Test::Deep::DNE;
35
3630s next if Test::Deep::descend($got_elem, $exp_elem);
# spent 38µs making 3 calls to Test::Deep::descend, avg 13µs/call, recursion: max depth 2, sum of overlapping time 38µs
37
38 return 0;
39 }
40
41 return 1;
42}
43
44sub getMaster
45
# spent 39µs within Test::Deep::HashElements::getMaster which was called 3 times, avg 13µs/call: # 3 times (39µs+0s) by Test::Deep::HashElements::descend at line 27, avg 13µs/call
{
46956µs my $self = shift;
47
48 my ($got, $exp) = @_;
49
50 return keys %$got > keys %$exp ? $got : $exp;
51}
52
53sub render_stack
54{
55 my $self = shift;
56 my ($var, $data) = @_;
57 $var .= "->" unless $Test::Deep::Stack->incArrow;
58 $var .= '{"'.quotemeta($data->{index}).'"}';
59
60 return $var;
61}
62
63sub reset_arrow
64{
65 return 0;
66}
67
68package Test::Deep::SuperHashElements;
69
702267µs2670µs
# spent 353µs (36+317) within Test::Deep::SuperHashElements::BEGIN@70 which was called: # once (36µs+317µs) by Test::Deep::Hash::hash_elements at line 70
use base 'Test::Deep::HashElements';
# spent 353µs making 1 call to Test::Deep::SuperHashElements::BEGIN@70 # spent 317µs making 1 call to base::import
71
72sub getMaster
73{
74 my $self = shift;
75
76 my ($got, $exp) = @_;
77
78 return $exp;
79}
80
81package Test::Deep::SubHashElements;
82
832218µs2548µs
# spent 288µs (29+259) within Test::Deep::SubHashElements::BEGIN@83 which was called: # once (29µs+259µs) by Test::Deep::Hash::hash_elements at line 83
use base 'Test::Deep::HashElements';
# spent 288µs making 1 call to Test::Deep::SubHashElements::BEGIN@83 # spent 259µs making 1 call to base::import
84
85sub getMaster
86{
87 my $self = shift;
88
89 my ($got, $exp) = @_;
90
91 return $got;
92}
93
9418µs1;