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

File /usr/local/lib/perl5/5.10.1/Test/Deep/HashKeys.pm
Statements Executed 44
Statement Execution Time 592µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
211641µs958µsTest::Deep::HashKeys::::hashkeysonly Test::Deep::HashKeys::hashkeysonly
21127µs2.76msTest::Deep::HashKeys::::descend Test::Deep::HashKeys::descend
21125µs29µsTest::Deep::HashKeys::::init Test::Deep::HashKeys::init
11110µs98µsTest::Deep::SuperHashKeys::::BEGIN@42Test::Deep::SuperHashKeys::BEGIN@42
11110µs62µsTest::Deep::SubHashKeys::::BEGIN@56 Test::Deep::SubHashKeys::BEGIN@56
1118µs24µsTest::Deep::HashKeys::::BEGIN@6 Test::Deep::HashKeys::BEGIN@6
2123µs3µsTest::Deep::HashKeys::::CORE:sort Test::Deep::HashKeys::CORE:sort (opcode)
0000s0sTest::Deep::SubHashKeys::::hashkeysonly Test::Deep::SubHashKeys::hashkeysonly
0000s0sTest::Deep::SuperHashKeys::::hashkeysonlyTest::Deep::SuperHashKeys::hashkeysonly
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1330µs226µsuse strict;
# spent 22µs making 1 call to Test::Deep::Hash::BEGIN@1 # spent 4µs making 1 call to strict::import
2334µs251µsuse warnings;
# spent 39µs making 1 call to Test::Deep::Hash::BEGIN@2 # spent 12µs making 1 call to warnings::import
3
4package Test::Deep::HashKeys;
5
63191µs240µs
# spent 24µs (8+16) within Test::Deep::HashKeys::BEGIN@6 which was called # once (8µs+16µs) by Test::Deep::Hash::hash_keys at line 6
use Test::Deep::Ref;
# spent 24µs making 1 call to Test::Deep::HashKeys::BEGIN@6 # spent 16µs making 1 call to Test::Deep::Cmp::import
7
8sub init
9
# spent 29µs (25+3) within Test::Deep::HashKeys::init which was called 2 times, avg 14µs/call: # 2 times (25µs+3µs) by Test::Deep::Cmp::new at line 32 of Test/Deep/Cmp.pm, avg 14µs/call
{
101030µs my $self = shift;
11
12 my %keys;
13 @keys{@_} = ();
14 $self->{val} = \%keys;
15 $self->{keys} = [sort @_];
# spent 3µs making 2 calls to Test::Deep::HashKeys::CORE:sort, avg 2µs/call
16}
17
18sub descend
19
# spent 2.76ms (27µs+2.74) within Test::Deep::HashKeys::descend which was called 2 times, avg 1.38ms/call: # 2 times (27µs+2.74ms) by Test::Deep::descend at line 312 of Test/Deep.pm, avg 1.38ms/call
{
201020µs my $self = shift;
21 my $got = shift;
22
23 my $exp = $self->{val};
24
25 return 0 unless $self->test_reftype($got, "HASH");
# spent 1.50ms making 2 calls to Test::Deep::Ref::test_reftype, avg 751µs/call
26
27 return Test::Deep::descend($got, $self->hashkeysonly($exp));
# spent 958µs making 2 calls to Test::Deep::HashKeys::hashkeysonly, avg 479µs/call # spent 275µs making 2 calls to Test::Deep::descend, avg 138µs/call, recursion: max depth 4, time 275µs
28}
29
30sub hashkeysonly
31
# spent 958µs (641+317) within Test::Deep::HashKeys::hashkeysonly which was called 2 times, avg 479µs/call: # 2 times (641µs+317µs) by Test::Deep::HashKeys::descend at line 27, avg 479µs/call
{
328117µs require Test::Deep::HashKeysOnly;
33
34 my $self = shift;
35 my $exp = shift;
36
37 return Test::Deep::HashKeysOnly->new(keys %$exp)
# spent 102µs making 2 calls to Test::Deep::Cmp::new, avg 51µs/call
38}
39
40package Test::Deep::SuperHashKeys;
41
42389µs2186µs
# spent 98µs (10+88) within Test::Deep::SuperHashKeys::BEGIN@42 which was called # once (10µs+88µs) by Test::Deep::Hash::hash_keys at line 42
use base 'Test::Deep::HashKeys';
# spent 98µs making 1 call to Test::Deep::SuperHashKeys::BEGIN@42 # spent 88µs making 1 call to base::import
43
44sub hashkeysonly
45{
46 require Test::Deep::HashKeysOnly;
47
48 my $self = shift;
49 my $exp = shift;
50
51 return Test::Deep::SuperHashKeysOnly->new(keys %$exp)
52}
53
54package Test::Deep::SubHashKeys;
55
56377µs2114µs
# spent 62µs (10+52) within Test::Deep::SubHashKeys::BEGIN@56 which was called # once (10µs+52µs) by Test::Deep::Hash::hash_keys at line 56
use base 'Test::Deep::HashKeys';
# spent 62µs making 1 call to Test::Deep::SubHashKeys::BEGIN@56 # spent 52µs making 1 call to base::import
57
58sub hashkeysonly
59{
60 require Test::Deep::HashKeysOnly;
61
62 my $self = shift;
63 my $exp = shift;
64
65 return Test::Deep::SubHashKeysOnly->new(keys %$exp)
66}
67
6813µs1;
# spent 3µs within Test::Deep::HashKeys::CORE:sort which was called 2 times, avg 2µs/call: # 2 times (3µs+0s) by Test::Deep::HashKeys::init at line 15 of Test/Deep/HashKeys.pm, avg 2µs/call
sub Test::Deep::HashKeys::CORE:sort; # xsub