Filename | /home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep/HashKeys.pm |
Statements | Executed 53 statements in 2.39ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 2.87ms | 4.31ms | hashkeysonly | Test::Deep::HashKeys::
3 | 1 | 1 | 164µs | 182µs | init | Test::Deep::HashKeys::
3 | 1 | 1 | 145µs | 9.24ms | descend | Test::Deep::HashKeys::
1 | 1 | 1 | 64µs | 85µs | BEGIN@1 | Test::Deep::Hash::
1 | 1 | 1 | 33µs | 340µs | BEGIN@42 | Test::Deep::SuperHashKeys::
1 | 1 | 1 | 30µs | 267µs | BEGIN@56 | Test::Deep::SubHashKeys::
1 | 1 | 1 | 30µs | 58µs | BEGIN@2 | Test::Deep::Hash::
1 | 1 | 1 | 27µs | 100µs | BEGIN@6 | Test::Deep::HashKeys::
0 | 0 | 0 | 0s | 0s | hashkeysonly | Test::Deep::SubHashKeys::
0 | 0 | 0 | 0s | 0s | hashkeysonly | Test::Deep::SuperHashKeys::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 109µs | 2 | 105µs | # spent 85µs (64+21) within Test::Deep::Hash::BEGIN@1 which was called:
# once (64µs+21µs) by Test::Deep::Hash::hash_keys at line 1 # spent 85µs making 1 call to Test::Deep::Hash::BEGIN@1
# spent 21µs making 1 call to strict::import |
2 | 2 | 122µs | 2 | 86µs | # spent 58µs (30+28) within Test::Deep::Hash::BEGIN@2 which was called:
# once (30µs+28µs) by Test::Deep::Hash::hash_keys at line 2 # spent 58µs making 1 call to Test::Deep::Hash::BEGIN@2
# spent 28µs making 1 call to warnings::import |
3 | |||||
4 | package Test::Deep::HashKeys; | ||||
5 | |||||
6 | 2 | 801µs | 2 | 172µs | # spent 100µs (27+72) within Test::Deep::HashKeys::BEGIN@6 which was called:
# once (27µs+72µs) by Test::Deep::Hash::hash_keys at line 6 # spent 100µs making 1 call to Test::Deep::HashKeys::BEGIN@6
# spent 72µs making 1 call to Test::Deep::Cmp::import |
7 | |||||
8 | sub init | ||||
9 | # spent 182µs (164+17) within Test::Deep::HashKeys::init which was called 3 times, avg 61µs/call:
# 3 times (164µs+17µs) by Test::Deep::Cmp::new at line 33 of Test/Deep/Cmp.pm, avg 61µs/call | ||||
10 | 15 | 181µs | my $self = shift; | ||
11 | |||||
12 | my %keys; | ||||
13 | @keys{@_} = (); | ||||
14 | $self->{val} = \%keys; | ||||
15 | 3 | 17µs | $self->{keys} = [sort @_]; # spent 17µs making 3 calls to Test::Deep::HashKeys::CORE:sort, avg 6µs/call | ||
16 | } | ||||
17 | |||||
18 | sub descend | ||||
19 | # spent 9.24ms (145µs+9.10) within Test::Deep::HashKeys::descend which was called 3 times, avg 3.08ms/call:
# 3 times (145µs+9.10ms) by Test::Deep::descend at line 328 of Test/Deep.pm, avg 3.08ms/call | ||||
20 | 15 | 123µs | my $self = shift; | ||
21 | my $got = shift; | ||||
22 | |||||
23 | my $exp = $self->{val}; | ||||
24 | |||||
25 | 3 | 2.87ms | return 0 unless $self->test_reftype($got, "HASH"); # spent 2.87ms making 3 calls to Test::Deep::Ref::test_reftype, avg 957µs/call | ||
26 | |||||
27 | 6 | 4.31ms | return Test::Deep::descend($got, $self->hashkeysonly($exp)); # spent 4.31ms making 3 calls to Test::Deep::HashKeys::hashkeysonly, avg 1.44ms/call
# spent 1.92ms making 3 calls to Test::Deep::descend, avg 639µs/call, recursion: max depth 2, sum of overlapping time 1.92ms | ||
28 | } | ||||
29 | |||||
30 | sub hashkeysonly | ||||
31 | # spent 4.31ms (2.87+1.44) within Test::Deep::HashKeys::hashkeysonly which was called 3 times, avg 1.44ms/call:
# 3 times (2.87ms+1.44ms) by Test::Deep::HashKeys::descend at line 27, avg 1.44ms/call | ||||
32 | 12 | 458µs | require Test::Deep::HashKeysOnly; | ||
33 | |||||
34 | my $self = shift; | ||||
35 | my $exp = shift; | ||||
36 | |||||
37 | 3 | 444µs | return Test::Deep::HashKeysOnly->new(keys %$exp) # spent 444µs making 3 calls to Test::Deep::Cmp::new, avg 148µs/call | ||
38 | } | ||||
39 | |||||
40 | package Test::Deep::SuperHashKeys; | ||||
41 | |||||
42 | 2 | 309µs | 2 | 648µs | # spent 340µs (33+307) within Test::Deep::SuperHashKeys::BEGIN@42 which was called:
# once (33µs+307µs) by Test::Deep::Hash::hash_keys at line 42 # spent 340µs making 1 call to Test::Deep::SuperHashKeys::BEGIN@42
# spent 307µs making 1 call to base::import |
43 | |||||
44 | sub 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 | |||||
54 | package Test::Deep::SubHashKeys; | ||||
55 | |||||
56 | 2 | 278µs | 2 | 503µs | # spent 267µs (30+237) within Test::Deep::SubHashKeys::BEGIN@56 which was called:
# once (30µs+237µs) by Test::Deep::Hash::hash_keys at line 56 # spent 267µs making 1 call to Test::Deep::SubHashKeys::BEGIN@56
# spent 237µs making 1 call to base::import |
57 | |||||
58 | sub 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 | |||||
68 | 1 | 9µs | 1; |