← 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/HashElements.pm
StatementsExecuted 149 statements in 695µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
211162µs241µsTest::Deep::HashElements::::descend Test::Deep::HashElements::descend
11116µs109µsTest::Deep::SuperHashElements::::BEGIN@70Test::Deep::SuperHashElements::BEGIN@70
11115µs30µsTest::Deep::Hash::::BEGIN@1.22 Test::Deep::Hash::BEGIN@1.22
11114µs7.60msTest::Deep::HashElements::::BEGIN@6 Test::Deep::HashElements::BEGIN@6
11110µs80µsTest::Deep::SubHashElements::::BEGIN@83 Test::Deep::SubHashElements::BEGIN@83
1119µs14µsTest::Deep::Hash::::BEGIN@2.23 Test::Deep::Hash::BEGIN@2.23
2117µs7µsTest::Deep::HashElements::::init Test::Deep::HashElements::init
2116µs6µsTest::Deep::HashElements::::getMaster Test::Deep::HashElements::getMaster
0000s0sTest::Deep::HashElements::::render_stack Test::Deep::HashElements::render_stack
0000s0sTest::Deep::HashElements::::reset_arrow Test::Deep::HashElements::reset_arrow
0000s0sTest::Deep::SubHashElements::::getMaster Test::Deep::SubHashElements::getMaster
0000s0sTest::Deep::SuperHashElements::::getMasterTest::Deep::SuperHashElements::getMaster
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1229µs244µs
# spent 30µs (15+14) within Test::Deep::Hash::BEGIN@1.22 which was called: # once (15µs+14µs) by Test::Deep::Hash::hash_elements at line 1
use strict;
# spent 30µs making 1 call to Test::Deep::Hash::BEGIN@1.22 # spent 14µs making 1 call to strict::import
2232µs219µs
# spent 14µs (9+5) within Test::Deep::Hash::BEGIN@2.23 which was called: # once (9µs+5µs) by Test::Deep::Hash::hash_elements at line 2
use warnings;
# spent 14µs making 1 call to Test::Deep::Hash::BEGIN@2.23 # spent 5µs making 1 call to warnings::import
3
4package Test::Deep::HashElements;
5
62325µs215.2ms
# spent 7.60ms (14µs+7.59) within Test::Deep::HashElements::BEGIN@6 which was called: # once (14µs+7.59ms) by Test::Deep::Hash::hash_elements at line 6
use Test::Deep::Ref;
# spent 7.60ms making 1 call to Test::Deep::HashElements::BEGIN@6 # spent 7.59ms making 1 call to Test::Deep::Cmp::import
7
8sub init
9
# spent 7µs within Test::Deep::HashElements::init which was called 2 times, avg 3µs/call: # 2 times (7µs+0s) by Test::Deep::Cmp::new at line 33 of Test/Deep/Cmp.pm, avg 3µs/call
{
102700ns my $self = shift;
11
122600ns my $val = shift;
13
14211µs $self->{val} = $val;
15}
16
17sub descend
18
# spent 241µs (162+80) within Test::Deep::HashElements::descend which was called 2 times, avg 121µs/call: # 2 times (162µs+80µs) by Test::Deep::descend at line 344 of Test/Deep.pm, avg 121µs/call
{
192900ns my $self = shift;
20
212700ns my $got = shift;
22
2322µs my $exp = $self->{val};
24
2527µs217µs my $data = $self->data;
# spent 17µs making 2 calls to Test::Deep::Cmp::data, avg 8µs/call
26
2723µs26µs my $master = $self->getMaster($got, $exp);
# spent 6µs making 2 calls to Test::Deep::HashElements::getMaster, avg 3µs/call
28
29215µs foreach my $key (keys %$master)
30 {
312815µs $data->{index} = $key;
32
332818µs my $got_elem = exists $got->{$key} ? $got->{$key} : $Test::Deep::DNE;
342814µs my $exp_elem = exists $exp->{$key} ? $exp->{$key} : $Test::Deep::DNE;
35
362840µs280s next if Test::Deep::descend($got_elem, $exp_elem);
# spent 57µs making 28 calls to Test::Deep::descend, avg 2µs/call, recursion: max depth 3, sum of overlapping time 57µs
37
38 return 0;
39 }
40
4128µs return 1;
42}
43
44sub getMaster
45
# spent 6µs within Test::Deep::HashElements::getMaster which was called 2 times, avg 3µs/call: # 2 times (6µs+0s) by Test::Deep::HashElements::descend at line 27, avg 3µs/call
{
462700ns my $self = shift;
47
4821µs my ($got, $exp) = @_;
49
5029µs return keys %$got > keys %$exp ? $got : $exp;
51}
52
53sub render_stack
54{
55 my $self = shift;
56 my ($var, $data) = @_;
57 $var .= "->" unless $Test::Deep::Stack->incArrow;
58 $var .= '{"'.quotemeta($data->{index}).'"}';
59
60 return $var;
61}
62
63sub reset_arrow
64{
65 return 0;
66}
67
68package Test::Deep::SuperHashElements;
69
70285µs2202µs
# spent 109µs (16+93) within Test::Deep::SuperHashElements::BEGIN@70 which was called: # once (16µs+93µs) by Test::Deep::Hash::hash_elements at line 70
use base 'Test::Deep::HashElements';
# spent 109µs making 1 call to Test::Deep::SuperHashElements::BEGIN@70 # spent 93µs making 1 call to base::import
71
72sub getMaster
73{
74 my $self = shift;
75
76 my ($got, $exp) = @_;
77
78 return $exp;
79}
80
81package Test::Deep::SubHashElements;
82
83274µs2149µs
# spent 80µs (10+69) within Test::Deep::SubHashElements::BEGIN@83 which was called: # once (10µs+69µs) by Test::Deep::Hash::hash_elements at line 83
use base 'Test::Deep::HashElements';
# spent 80µs making 1 call to Test::Deep::SubHashElements::BEGIN@83 # spent 69µs making 1 call to base::import
84
85sub getMaster
86{
87 my $self = shift;
88
89 my ($got, $exp) = @_;
90
91 return $got;
92}
93
9414µs1;