| Filename | /home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep/Stack.pm |
| Statements | Executed 689 statements in 8.05ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 144 | 1 | 1 | 2.51ms | 3.56ms | Test::Deep::Stack::push |
| 144 | 1 | 1 | 2.21ms | 3.02ms | Test::Deep::Stack::pop |
| 18 | 1 | 1 | 1.83ms | 3.00ms | Test::Deep::Stack::init |
| 1 | 1 | 1 | 1.81ms | 2.37ms | Test::Deep::Stack::BEGIN@9 |
| 24 | 1 | 1 | 760µs | 944µs | Test::Deep::Stack::getLast |
| 1 | 1 | 1 | 54µs | 72µs | Test::Deep::BEGIN@1.1 |
| 1 | 1 | 1 | 43µs | 110µs | Test::Deep::Stack::BEGIN@7 |
| 1 | 1 | 1 | 31µs | 62µs | Test::Deep::BEGIN@2.2 |
| 1 | 1 | 1 | 28µs | 166µs | Test::Deep::Stack::BEGIN@6 |
| 0 | 0 | 0 | 0s | 0s | Test::Deep::Stack::incArrow |
| 0 | 0 | 0 | 0s | 0s | Test::Deep::Stack::length |
| 0 | 0 | 0 | 0s | 0s | Test::Deep::Stack::render |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 2 | 95µs | 2 | 91µs | # spent 72µs (54+19) within Test::Deep::BEGIN@1.1 which was called:
# once (54µs+19µs) by Test::Deep::BEGIN@8 at line 1 # spent 72µs making 1 call to Test::Deep::BEGIN@1.1
# spent 18µs making 1 call to strict::import |
| 2 | 2 | 132µs | 2 | 94µs | # spent 62µs (31+32) within Test::Deep::BEGIN@2.2 which was called:
# once (31µs+32µs) by Test::Deep::BEGIN@8 at line 2 # spent 62µs making 1 call to Test::Deep::BEGIN@2.2
# spent 32µs making 1 call to warnings::import |
| 3 | |||||
| 4 | package Test::Deep::Stack; | ||||
| 5 | |||||
| 6 | 2 | 108µs | 2 | 304µs | # spent 166µs (28+138) within Test::Deep::Stack::BEGIN@6 which was called:
# once (28µs+138µs) by Test::Deep::BEGIN@8 at line 6 # spent 166µs making 1 call to Test::Deep::Stack::BEGIN@6
# spent 138µs making 1 call to Exporter::import |
| 7 | 2 | 111µs | 2 | 178µs | # spent 110µs (43+68) within Test::Deep::Stack::BEGIN@7 which was called:
# once (43µs+68µs) by Test::Deep::BEGIN@8 at line 7 # spent 110µs making 1 call to Test::Deep::Stack::BEGIN@7
# spent 68µs making 1 call to Exporter::import |
| 8 | |||||
| 9 | 2 | 1.55ms | 2 | 2.67ms | # spent 2.37ms (1.81+567µs) within Test::Deep::Stack::BEGIN@9 which was called:
# once (1.81ms+567µs) by Test::Deep::BEGIN@8 at line 9 # spent 2.37ms making 1 call to Test::Deep::Stack::BEGIN@9
# spent 298µs making 1 call to Test::Deep::MM::import |
| 10 | |||||
| 11 | sub init | ||||
| 12 | # spent 3.00ms (1.83+1.17) within Test::Deep::Stack::init which was called 18 times, avg 167µs/call:
# 18 times (1.83ms+1.17ms) by Test::Deep::MM::new at line 46 of Test/Deep/MM.pm, avg 167µs/call | ||||
| 13 | 18 | 34µs | my $self = shift; | ||
| 14 | |||||
| 15 | 18 | 742µs | 18 | 346µs | $self->SUPER::init(@_); # spent 346µs making 18 calls to Test::Deep::MM::init, avg 19µs/call |
| 16 | |||||
| 17 | 18 | 775µs | 36 | 829µs | $self->setStack([]) unless $self->getStack; # spent 452µs making 18 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:28], avg 25µs/call
# spent 377µs making 18 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 21µs/call |
| 18 | } | ||||
| 19 | |||||
| 20 | sub push | ||||
| 21 | # spent 3.56ms (2.51+1.04) within Test::Deep::Stack::push which was called 144 times, avg 25µs/call:
# 144 times (2.51ms+1.04ms) by Test::Deep::descend at line 319 of Test/Deep.pm, avg 25µs/call | ||||
| 22 | 144 | 150µs | my $self = shift; | ||
| 23 | |||||
| 24 | 144 | 1.98ms | 144 | 1.04ms | push(@{$self->getStack}, @_); # spent 1.04ms making 144 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 7µs/call |
| 25 | } | ||||
| 26 | |||||
| 27 | sub pop | ||||
| 28 | # spent 3.02ms (2.21+814µs) within Test::Deep::Stack::pop which was called 144 times, avg 21µs/call:
# 144 times (2.21ms+814µs) by Test::Deep::descend at line 331 of Test/Deep.pm, avg 21µs/call | ||||
| 29 | 144 | 171µs | my $self = shift; | ||
| 30 | |||||
| 31 | 144 | 1.62ms | 144 | 814µs | return pop @{$self->getStack}; # spent 814µs making 144 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 6µs/call |
| 32 | } | ||||
| 33 | |||||
| 34 | sub render | ||||
| 35 | { | ||||
| 36 | my $self = shift; | ||||
| 37 | my $var = shift; | ||||
| 38 | |||||
| 39 | my $stack = $self->getStack; | ||||
| 40 | |||||
| 41 | $self->setArrow(0); | ||||
| 42 | |||||
| 43 | foreach my $data (@$stack) | ||||
| 44 | { | ||||
| 45 | my $exp = $data->{exp}; | ||||
| 46 | if (Scalar::Util::blessed($exp) and $exp->isa("Test::Deep::Cmp")) | ||||
| 47 | { | ||||
| 48 | $var = $exp->render_stack($var, $data); | ||||
| 49 | |||||
| 50 | $self->setArrow(0) if $exp->reset_arrow; | ||||
| 51 | } | ||||
| 52 | else | ||||
| 53 | { | ||||
| 54 | confess "Don't know how to render '$exp'"; | ||||
| 55 | } | ||||
| 56 | } | ||||
| 57 | |||||
| 58 | return $var; | ||||
| 59 | } | ||||
| 60 | |||||
| 61 | sub getLast | ||||
| 62 | # spent 944µs (760+184) within Test::Deep::Stack::getLast which was called 24 times, avg 39µs/call:
# 24 times (760µs+184µs) by Test::Deep::Cmp::data at line 128 of Test/Deep/Cmp.pm, avg 39µs/call | ||||
| 63 | 24 | 111µs | my $self = shift; | ||
| 64 | |||||
| 65 | 24 | 456µs | 24 | 184µs | return $self->getStack->[-1]; # spent 184µs making 24 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 8µs/call |
| 66 | } | ||||
| 67 | |||||
| 68 | sub incArrow | ||||
| 69 | { | ||||
| 70 | my $self = shift; | ||||
| 71 | |||||
| 72 | my $a = $self->getArrow; | ||||
| 73 | $self->setArrow($a + 1); | ||||
| 74 | |||||
| 75 | return $a; | ||||
| 76 | } | ||||
| 77 | |||||
| 78 | sub length | ||||
| 79 | { | ||||
| 80 | my $self = shift; | ||||
| 81 | |||||
| 82 | return @{$self->getStack} + 0; | ||||
| 83 | } | ||||
| 84 | |||||
| 85 | 1 | 9µs | 1; |