File | /usr/local/lib/perl5/5.10.1/Test/Deep/HashKeys.pm |
Statements Executed | 44 |
Statement Execution Time | 592µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 1 | 1 | 641µs | 958µs | hashkeysonly | Test::Deep::HashKeys::
2 | 1 | 1 | 27µs | 2.76ms | descend | Test::Deep::HashKeys::
2 | 1 | 1 | 25µs | 29µs | init | Test::Deep::HashKeys::
1 | 1 | 1 | 10µs | 98µs | BEGIN@42 | Test::Deep::SuperHashKeys::
1 | 1 | 1 | 10µs | 62µs | BEGIN@56 | Test::Deep::SubHashKeys::
1 | 1 | 1 | 8µs | 24µs | BEGIN@6 | Test::Deep::HashKeys::
2 | 1 | 2 | 3µs | 3µs | CORE:sort (opcode) | 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 | 3 | 30µs | 2 | 26µs | use strict; # spent 22µs making 1 call to Test::Deep::Hash::BEGIN@1
# spent 4µs making 1 call to strict::import |
2 | 3 | 34µs | 2 | 51µs | use warnings; # spent 39µs making 1 call to Test::Deep::Hash::BEGIN@2
# spent 12µs making 1 call to warnings::import |
3 | |||||
4 | package Test::Deep::HashKeys; | ||||
5 | |||||
6 | 3 | 191µs | 2 | 40µ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 # spent 24µs making 1 call to Test::Deep::HashKeys::BEGIN@6
# spent 16µs making 1 call to Test::Deep::Cmp::import |
7 | |||||
8 | sub 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 | ||||
10 | 10 | 30µ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 | |||||
18 | sub 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 | ||||
20 | 10 | 20µ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 | |||||
30 | sub 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 | ||||
32 | 8 | 117µ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 | |||||
40 | package Test::Deep::SuperHashKeys; | ||||
41 | |||||
42 | 3 | 89µs | 2 | 186µ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 # spent 98µs making 1 call to Test::Deep::SuperHashKeys::BEGIN@42
# spent 88µ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 | 3 | 77µs | 2 | 114µ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 # spent 62µs making 1 call to Test::Deep::SubHashKeys::BEGIN@56
# spent 52µ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 | 3µs | 1; | ||
# 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 |