← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 05.Domain_and_Item.t
  Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:23:15 2010

File /usr/local/lib/perl5/5.10.1/Test/Deep/Stack.pm
Statements Executed 158
Statement Execution Time 623µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111348µs473µsTest::Deep::Stack::::BEGIN@8Test::Deep::Stack::BEGIN@8
3211110µs158µsTest::Deep::Stack::::pushTest::Deep::Stack::push
321194µs126µsTest::Deep::Stack::::popTest::Deep::Stack::pop
11148µs60µsTest::Deep::Stack::::initTest::Deep::Stack::init
71130µs37µsTest::Deep::Stack::::getLastTest::Deep::Stack::getLast
1117µs35µsTest::Deep::Stack::::BEGIN@6Test::Deep::Stack::BEGIN@6
0000s0sTest::Deep::Stack::::incArrowTest::Deep::Stack::incArrow
0000s0sTest::Deep::Stack::::lengthTest::Deep::Stack::length
0000s0sTest::Deep::Stack::::renderTest::Deep::Stack::render
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1320µs219µsuse strict;
# spent 16µs making 1 call to Test::Deep::BEGIN@1 # spent 3µs making 1 call to strict::import
2329µs224µsuse warnings;
# spent 15µs making 1 call to Test::Deep::BEGIN@2 # spent 9µs making 1 call to warnings::import
3
4package Test::Deep::Stack;
5
6325µs264µs
# spent 35µs (7+29) within Test::Deep::Stack::BEGIN@6 which was called # once (7µs+29µs) by Test::Deep::BEGIN@8 at line 6
use Carp qw( confess );
# spent 35µs making 1 call to Test::Deep::Stack::BEGIN@6 # spent 29µs making 1 call to Exporter::import
7
83298µs2537µs
# spent 473µs (348+125) within Test::Deep::Stack::BEGIN@8 which was called # once (348µs+125µs) by Test::Deep::BEGIN@8 at line 8
use Test::Deep::MM qw( new init Stack Arrow );
# spent 473µs making 1 call to Test::Deep::Stack::BEGIN@8 # spent 64µs making 1 call to Test::Deep::MM::import
9
10sub init
11
# spent 60µs (48+12) within Test::Deep::Stack::init which was called # once (48µs+12µs) by Test::Deep::MM::new at line 46 of Test/Deep/MM.pm
{
121700ns my $self = shift;
13
14122µs14µs $self->SUPER::init(@_);
# spent 4µs making 1 call to Test::Deep::MM::init
15
16116µs28µs $self->setStack([]) unless $self->getStack;
# spent 4µs making 1 call to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25] # spent 4µs making 1 call to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:28]
17}
18
19sub push
20
# spent 158µs (110+47) within Test::Deep::Stack::push which was called 32 times, avg 5µs/call: # 32 times (110µs+47µs) by Test::Deep::descend at line 303 of Test/Deep.pm, avg 5µs/call
{
21327µs my $self = shift;
22
2332104µs3247µs push(@{$self->getStack}, @_);
# spent 47µs making 32 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 1µs/call
24}
25
26sub pop
27
# spent 126µs (94+31) within Test::Deep::Stack::pop which was called 32 times, avg 4µs/call: # 32 times (94µs+31µs) by Test::Deep::descend at line 315 of Test/Deep.pm, avg 4µs/call
{
28327µs my $self = shift;
29
303270µs3231µs return pop @{$self->getStack};
# spent 31µs making 32 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 981ns/call
31}
32
33sub render
34{
35 my $self = shift;
36 my $var = shift;
37
38 my $stack = $self->getStack;
39
40 $self->setArrow(0);
41
42 foreach my $data (@$stack)
43 {
44 my $exp = $data->{exp};
45 if (UNIVERSAL::isa($exp, "Test::Deep::Cmp"))
46 {
47 $var = $exp->render_stack($var, $data);
48
49 $self->setArrow(0) if $exp->reset_arrow;
50 }
51 else
52 {
53 confess "Don't know how to render '$exp'";
54 }
55 }
56
57 return $var;
58}
59
60sub getLast
61
# spent 37µs (30+7) within Test::Deep::Stack::getLast which was called 7 times, avg 5µs/call: # 7 times (30µs+7µs) by Test::Deep::Cmp::data at line 127 of Test/Deep/Cmp.pm, avg 5µs/call
{
6271µs my $self = shift;
63
64721µs77µs return $self->getStack->[-1];
# spent 7µs making 7 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 1µs/call
65}
66
67sub incArrow
68{
69 my $self = shift;
70
71 my $a = $self->getArrow;
72 $self->setArrow($a + 1);
73
74 return $a;
75}
76
77sub length
78{
79 my $self = shift;
80
81 return @{$self->getStack} + 0;
82}
83
8413µs1;