← 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:37 2010

File /usr/local/lib/perl5/5.10.1/Test/Deep/HashElements.pm
Statements Executed 82
Statement Execution Time 524µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
21176µs3.92msTest::Deep::HashElements::::descend Test::Deep::HashElements::descend
33357µs68µsTest::Deep::Hash::::BEGIN@1 Test::Deep::Hash::BEGIN@1
33345µs79µsTest::Deep::Hash::::BEGIN@2 Test::Deep::Hash::BEGIN@2
1119µs86µsTest::Deep::SuperHashElements::::BEGIN@70Test::Deep::SuperHashElements::BEGIN@70
1119µs54µsTest::Deep::SubHashElements::::BEGIN@83 Test::Deep::SubHashElements::BEGIN@83
1118µs33µsTest::Deep::HashElements::::BEGIN@6 Test::Deep::HashElements::BEGIN@6
2115µs5µsTest::Deep::HashElements::::getMaster Test::Deep::HashElements::getMaster
2114µs4µsTest::Deep::HashElements::::init Test::Deep::HashElements::init
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
1327µs228µs
# spent 68µs (57+11) within Test::Deep::Hash::BEGIN@1 which was called 3 times, avg 23µs/call: # once (21µs+3µs) by Test::Deep::Hash::hash_elements at line 1 # once (18µs+4µs) by Test::Deep::Hash::hash_keys at line 1 of Test/Deep/HashKeys.pm # once (18µs+4µs) by Test::Deep::Hash::BEGIN@6 at line 1 of Test/Deep/Ref.pm
use strict;
# spent 24µs making 1 call to Test::Deep::Hash::BEGIN@1 # spent 3µs making 1 call to strict::import
2330µs230µs
# spent 79µs (45+34) within Test::Deep::Hash::BEGIN@2 which was called 3 times, avg 26µs/call: # once (27µs+12µs) by Test::Deep::Hash::hash_keys at line 2 of Test/Deep/HashKeys.pm # once (10µs+11µs) by Test::Deep::Hash::BEGIN@6 at line 2 of Test/Deep/Ref.pm # once (8µs+11µs) by Test::Deep::Hash::hash_elements at line 2
use warnings;
# spent 19µs making 1 call to Test::Deep::Hash::BEGIN@2 # spent 11µs making 1 call to warnings::import
3
4package Test::Deep::HashElements;
5
63258µs257µs
# spent 33µs (8+25) within Test::Deep::HashElements::BEGIN@6 which was called # once (8µs+25µs) by Test::Deep::Hash::hash_elements at line 6
use Test::Deep::Ref;
# spent 33µs making 1 call to Test::Deep::HashElements::BEGIN@6 # spent 25µs making 1 call to Test::Deep::Cmp::import
7
8sub init
9
# spent 4µs within Test::Deep::HashElements::init which was called 2 times, avg 2µs/call: # 2 times (4µs+0s) by Test::Deep::Cmp::new at line 32 of Test/Deep/Cmp.pm, avg 2µs/call
{
1068µs my $self = shift;
11
12 my $val = shift;
13
14 $self->{val} = $val;
15}
16
17sub descend
18
# spent 3.92ms (76µs+3.85) within Test::Deep::HashElements::descend which was called 2 times, avg 1.96ms/call: # 2 times (76µs+3.85ms) by Test::Deep::descend at line 312 of Test/Deep.pm, avg 1.96ms/call
{
191418µs my $self = shift;
20
21 my $got = shift;
22
23 my $exp = $self->{val};
24
25 my $data = $self->data;
# spent 13µs making 2 calls to Test::Deep::Cmp::data, avg 7µs/call
26
27 my $master = $self->getMaster($got, $exp);
# spent 5µs making 2 calls to Test::Deep::HashElements::getMaster, avg 3µs/call
28
29 foreach my $key (keys %$master)
30 {
314031µs $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
36 next if Test::Deep::descend($got_elem, $exp_elem);
# spent 3.89ms making 10 calls to Test::Deep::descend, avg 389µs/call, recursion: max depth 4, time 3.89ms
37
38 return 0;
39 }
40
41 return 1;
42}
43
44sub getMaster
45
# spent 5µs within Test::Deep::HashElements::getMaster which was called 2 times, avg 3µs/call: # 2 times (5µs+0s) by Test::Deep::HashElements::descend at line 27, avg 3µs/call
{
4668µ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
70371µs2162µs
# spent 86µs (9+77) within Test::Deep::SuperHashElements::BEGIN@70 which was called # once (9µs+77µs) by Test::Deep::Hash::hash_elements at line 70
use base 'Test::Deep::HashElements';
# spent 86µs making 1 call to Test::Deep::SuperHashElements::BEGIN@70 # spent 77µ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
83370µs2100µs
# spent 54µs (9+45) within Test::Deep::SubHashElements::BEGIN@83 which was called # once (9µs+45µs) by Test::Deep::Hash::hash_elements at line 83
use base 'Test::Deep::HashElements';
# spent 54µs making 1 call to Test::Deep::SubHashElements::BEGIN@83 # spent 45µ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
9413µs1;