File | /usr/local/lib/perl5/5.10.1/Test/Deep/Stack.pm |
Statements Executed | 158 |
Statement Execution Time | 624µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 348µs | 473µs | BEGIN@8 | Test::Deep::Stack::
32 | 1 | 1 | 110µs | 158µs | push | Test::Deep::Stack::
32 | 1 | 1 | 94µs | 126µs | pop | Test::Deep::Stack::
1 | 1 | 1 | 48µs | 60µs | init | Test::Deep::Stack::
7 | 1 | 1 | 30µs | 37µs | getLast | Test::Deep::Stack::
1 | 1 | 1 | 7µs | 35µs | BEGIN@6 | Test::Deep::Stack::
0 | 0 | 0 | 0s | 0s | incArrow | Test::Deep::Stack::
0 | 0 | 0 | 0s | 0s | length | Test::Deep::Stack::
0 | 0 | 0 | 0s | 0s | render | Test::Deep::Stack::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 3 | 20µs | 2 | 19µs | use strict; # spent 16µs making 1 call to Test::Deep::BEGIN@1
# spent 3µs making 1 call to strict::import |
2 | 3 | 29µs | 2 | 24µs | use warnings; # spent 15µs making 1 call to Test::Deep::BEGIN@2
# spent 9µs making 1 call to warnings::import |
3 | |||||
4 | package Test::Deep::Stack; | ||||
5 | |||||
6 | 3 | 25µs | 2 | 64µ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 # spent 35µs making 1 call to Test::Deep::Stack::BEGIN@6
# spent 29µs making 1 call to Exporter::import |
7 | |||||
8 | 3 | 298µs | 2 | 537µ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 # spent 473µs making 1 call to Test::Deep::Stack::BEGIN@8
# spent 64µs making 1 call to Test::Deep::MM::import |
9 | |||||
10 | sub 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 | ||||
12 | 3 | 39µs | my $self = shift; | ||
13 | |||||
14 | $self->SUPER::init(@_); # spent 4µs making 1 call to Test::Deep::MM::init | ||||
15 | |||||
16 | $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 | |||||
19 | sub 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 | ||||
21 | 64 | 111µs | my $self = shift; | ||
22 | |||||
23 | 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 | |||||
26 | sub 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 | ||||
28 | 64 | 77µs | my $self = shift; | ||
29 | |||||
30 | 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 | |||||
33 | sub 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 | |||||
60 | sub 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 | ||||
62 | 14 | 22µs | my $self = shift; | ||
63 | |||||
64 | 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 | |||||
67 | sub incArrow | ||||
68 | { | ||||
69 | my $self = shift; | ||||
70 | |||||
71 | my $a = $self->getArrow; | ||||
72 | $self->setArrow($a + 1); | ||||
73 | |||||
74 | return $a; | ||||
75 | } | ||||
76 | |||||
77 | sub length | ||||
78 | { | ||||
79 | my $self = shift; | ||||
80 | |||||
81 | return @{$self->getStack} + 0; | ||||
82 | } | ||||
83 | |||||
84 | 1 | 3µs | 1; |