← Index
NYTProf Performance Profile   « line view »
For t/optimization.t
  Run on Thu Jan 8 22:47:42 2015
Reported on Thu Jan 8 22:48:06 2015

Filename/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep/HashKeys.pm
StatementsExecuted 39 statements in 562µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
211925µs1.57msTest::Deep::HashKeys::::hashkeysonly Test::Deep::HashKeys::hashkeysonly
21137µs47µsTest::Deep::HashKeys::::init Test::Deep::HashKeys::init
21135µs3.57msTest::Deep::HashKeys::::descend Test::Deep::HashKeys::descend
11115µs29µsTest::Deep::Hash::::BEGIN@1.14 Test::Deep::Hash::BEGIN@1.14
11110µs85µsTest::Deep::SuperHashKeys::::BEGIN@42Test::Deep::SuperHashKeys::BEGIN@42
11110µs15µsTest::Deep::Hash::::BEGIN@2.15 Test::Deep::Hash::BEGIN@2.15
11110µs78µsTest::Deep::SubHashKeys::::BEGIN@56 Test::Deep::SubHashKeys::BEGIN@56
21110µs10µsTest::Deep::HashKeys::::CORE:sort Test::Deep::HashKeys::CORE:sort (opcode)
1119µs26µsTest::Deep::HashKeys::::BEGIN@6 Test::Deep::HashKeys::BEGIN@6
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
1228µs243µ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
use strict;
# spent 29µs making 1 call to Test::Deep::Hash::BEGIN@1.14 # spent 14µs making 1 call to strict::import
2230µs220µ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
use warnings;
# spent 15µs making 1 call to Test::Deep::Hash::BEGIN@2.15 # spent 5µs making 1 call to warnings::import
3
4package Test::Deep::HashKeys;
5
62176µs244µ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
use Test::Deep::Ref;
# spent 26µs making 1 call to Test::Deep::HashKeys::BEGIN@6 # spent 18µs making 1 call to Test::Deep::Cmp::import
7
8sub 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
{
102700ns my $self = shift;
11
1221µs my %keys;
13210µs @keys{@_} = ();
1424µs $self->{val} = \%keys;
15236µs210µs $self->{keys} = [sort @_];
# spent 10µs making 2 calls to Test::Deep::HashKeys::CORE:sort, avg 5µs/call
16}
17
18sub 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
{
202800ns my $self = shift;
212600ns my $got = shift;
22
2322µs my $exp = $self->{val};
24
2529µs21.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
27215µs41.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
30sub 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
{
32272µs require Test::Deep::HashKeysOnly;
33
3421µs my $self = shift;
352500ns my $exp = shift;
36
37232µs2263µ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
40package Test::Deep::SuperHashKeys;
41
42273µs2160µ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
use base 'Test::Deep::HashKeys';
# spent 85µs making 1 call to Test::Deep::SuperHashKeys::BEGIN@42 # spent 75µ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
56268µs2146µ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
use base 'Test::Deep::HashKeys';
# spent 78µs making 1 call to Test::Deep::SubHashKeys::BEGIN@56 # spent 68µ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
6812µs1;
 
# 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
sub Test::Deep::HashKeys::CORE:sort; # opcode