Filename | /home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep/HashKeys.pm |
Statements | Executed 39 statements in 562µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 1 | 1 | 925µs | 1.57ms | hashkeysonly | Test::Deep::HashKeys::
2 | 1 | 1 | 37µs | 47µs | init | Test::Deep::HashKeys::
2 | 1 | 1 | 35µs | 3.57ms | descend | Test::Deep::HashKeys::
1 | 1 | 1 | 15µs | 29µs | BEGIN@1.14 | Test::Deep::Hash::
1 | 1 | 1 | 10µs | 85µs | BEGIN@42 | Test::Deep::SuperHashKeys::
1 | 1 | 1 | 10µs | 15µs | BEGIN@2.15 | Test::Deep::Hash::
1 | 1 | 1 | 10µs | 78µs | BEGIN@56 | Test::Deep::SubHashKeys::
2 | 1 | 1 | 10µs | 10µs | CORE:sort (opcode) | Test::Deep::HashKeys::
1 | 1 | 1 | 9µs | 26µ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 | 28µs | 2 | 43µs | # spent 29µs (15+14) within Test::Deep::Hash::BEGIN@1.14 which was called:
# once (15µs+14µs) by Test::Deep::Hash::hash_keys at line 1 # spent 29µs making 1 call to Test::Deep::Hash::BEGIN@1.14
# spent 14µs making 1 call to strict::import |
2 | 2 | 30µs | 2 | 20µs | # spent 15µs (10+5) within Test::Deep::Hash::BEGIN@2.15 which was called:
# once (10µs+5µs) by Test::Deep::Hash::hash_keys at line 2 # spent 15µs making 1 call to Test::Deep::Hash::BEGIN@2.15
# spent 5µs making 1 call to warnings::import |
3 | |||||
4 | package Test::Deep::HashKeys; | ||||
5 | |||||
6 | 2 | 176µs | 2 | 44µs | # spent 26µs (9+18) within Test::Deep::HashKeys::BEGIN@6 which was called:
# once (9µs+18µs) by Test::Deep::Hash::hash_keys at line 6 # spent 26µs making 1 call to Test::Deep::HashKeys::BEGIN@6
# spent 18µs making 1 call to Test::Deep::Cmp::import |
7 | |||||
8 | sub init | ||||
9 | # spent 47µs (37+9) within Test::Deep::HashKeys::init which was called 2 times, avg 23µs/call:
# 2 times (37µs+9µs) by Test::Deep::Cmp::new at line 33 of Test/Deep/Cmp.pm, avg 23µs/call | ||||
10 | 2 | 700ns | my $self = shift; | ||
11 | |||||
12 | 2 | 1µs | my %keys; | ||
13 | 2 | 10µs | @keys{@_} = (); | ||
14 | 2 | 4µs | $self->{val} = \%keys; | ||
15 | 2 | 36µs | 2 | 10µs | $self->{keys} = [sort @_]; # spent 10µs making 2 calls to Test::Deep::HashKeys::CORE:sort, avg 5µs/call |
16 | } | ||||
17 | |||||
18 | sub descend | ||||
19 | # spent 3.57ms (35µs+3.54) within Test::Deep::HashKeys::descend which was called 2 times, avg 1.79ms/call:
# 2 times (35µs+3.54ms) by Test::Deep::descend at line 344 of Test/Deep.pm, avg 1.79ms/call | ||||
20 | 2 | 800ns | my $self = shift; | ||
21 | 2 | 600ns | my $got = shift; | ||
22 | |||||
23 | 2 | 2µs | my $exp = $self->{val}; | ||
24 | |||||
25 | 2 | 9µs | 2 | 1.50ms | 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 | 2 | 15µs | 4 | 1.57ms | return Test::Deep::descend($got, $self->hashkeysonly($exp)); # spent 1.57ms making 2 calls to Test::Deep::HashKeys::hashkeysonly, avg 787µs/call
# spent 461µs making 2 calls to Test::Deep::descend, avg 231µs/call, recursion: max depth 3, sum of overlapping time 461µs |
28 | } | ||||
29 | |||||
30 | sub hashkeysonly | ||||
31 | # spent 1.57ms (925µs+650µs) within Test::Deep::HashKeys::hashkeysonly which was called 2 times, avg 787µs/call:
# 2 times (925µs+650µs) by Test::Deep::HashKeys::descend at line 27, avg 787µs/call | ||||
32 | 2 | 72µs | require Test::Deep::HashKeysOnly; | ||
33 | |||||
34 | 2 | 1µs | my $self = shift; | ||
35 | 2 | 500ns | my $exp = shift; | ||
36 | |||||
37 | 2 | 32µs | 2 | 263µs | return Test::Deep::HashKeysOnly->new(keys %$exp) # spent 263µs making 2 calls to Test::Deep::Cmp::new, avg 132µs/call |
38 | } | ||||
39 | |||||
40 | package Test::Deep::SuperHashKeys; | ||||
41 | |||||
42 | 2 | 73µs | 2 | 160µs | # spent 85µs (10+75) within Test::Deep::SuperHashKeys::BEGIN@42 which was called:
# once (10µs+75µs) by Test::Deep::Hash::hash_keys at line 42 # spent 85µs making 1 call to Test::Deep::SuperHashKeys::BEGIN@42
# spent 75µ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 | 68µs | 2 | 146µs | # spent 78µs (10+68) within Test::Deep::SubHashKeys::BEGIN@56 which was called:
# once (10µs+68µs) by Test::Deep::Hash::hash_keys at line 56 # spent 78µs making 1 call to Test::Deep::SubHashKeys::BEGIN@56
# spent 68µ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 | 2µs | 1; | ||
# spent 10µs within Test::Deep::HashKeys::CORE:sort which was called 2 times, avg 5µs/call:
# 2 times (10µs+0s) by Test::Deep::HashKeys::init at line 15, avg 5µs/call |