Profile of Test/Deep/Stack.pm

← 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:05 2015

Filename | /home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep/Stack.pm
Statements | Executed 111 statements in 774µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 454µs | 633µs | Test::Deep::Stack::::BEGIN@9Test::Deep::Stack::BEGIN@9
18 | 1 | 1 | 116µs | 139µs | Test::Deep::Stack::::popTest::Deep::Stack::pop
18 | 1 | 1 | 92µs | 124µs | Test::Deep::Stack::::pushTest::Deep::Stack::push
4 | 1 | 1 | 88µs | 118µs | Test::Deep::Stack::::initTest::Deep::Stack::init
8 | 1 | 1 | 41µs | 54µs | Test::Deep::Stack::::getLastTest::Deep::Stack::getLast
1 | 1 | 1 | 15µs | 31µs | Test::Deep::::BEGIN@1.1 Test::Deep::BEGIN@1.1
1 | 1 | 1 | 10µs | 16µs | Test::Deep::::BEGIN@2.2 Test::Deep::BEGIN@2.2
1 | 1 | 1 | 10µs | 25µs | Test::Deep::Stack::::BEGIN@7Test::Deep::Stack::BEGIN@7
1 | 1 | 1 | 9µs | 38µs | Test::Deep::Stack::::BEGIN@6Test::Deep::Stack::BEGIN@6
0 | 0 | 0 | 0s | 0s | Test::Deep::Stack::::incArrowTest::Deep::Stack::incArrow
0 | 0 | 0 | 0s | 0s | Test::Deep::Stack::::lengthTest::Deep::Stack::length
0 | 0 | 0 | 0s | 0s | Test::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
--- | --- | --- | --- | --- | ---
1 | 2 | 34µs | 2 | 47µs | # spent 31µs (15+16) within Test::Deep::BEGIN@1.1 which was called: # once (15µs+16µs) by Test::Deep::BEGIN@8 at line 1 use strict; # spent 31µs making 1 call to Test::Deep::BEGIN@1.1 # spent 16µs making 1 call to strict::import
2 | 2 | 36µs | 2 | 23µs | # spent 16µs (10+6) within Test::Deep::BEGIN@2.2 which was called: # once (10µs+6µs) by Test::Deep::BEGIN@8 at line 2 use warnings; # spent 16µs making 1 call to Test::Deep::BEGIN@2.2 # spent 6µs making 1 call to warnings::import
3 |  |  |  |  |
4 |  |  |  |  | package Test::Deep::Stack;
5 |  |  |  |  |
6 | 2 | 26µs | 2 | 67µs | # spent 38µs (9+29) within Test::Deep::Stack::BEGIN@6 which was called: # once (9µs+29µs) by Test::Deep::BEGIN@8 at line 6 use Carp qw( confess ); # spent 38µs making 1 call to Test::Deep::Stack::BEGIN@6 # spent 29µs making 1 call to Exporter::import
7 | 2 | 29µs | 2 | 40µs | # spent 25µs (10+15) within Test::Deep::Stack::BEGIN@7 which was called: # once (10µs+15µs) by Test::Deep::BEGIN@8 at line 7 use Scalar::Util; # spent 25µs making 1 call to Test::Deep::Stack::BEGIN@7 # spent 15µs making 1 call to Exporter::import
8 |  |  |  |  |
9 | 2 | 400µs | 2 | 724µs | # spent 633µs (454+179) within Test::Deep::Stack::BEGIN@9 which was called: # once (454µs+179µs) by Test::Deep::BEGIN@8 at line 9 use Test::Deep::MM qw( new init Stack Arrow ); # spent 633µs making 1 call to Test::Deep::Stack::BEGIN@9 # spent 92µs making 1 call to Test::Deep::MM::import
10 |  |  |  |  |
11 |  |  |  |  | sub init
12 |  |  |  |  | # spent 118µs (88+30) within Test::Deep::Stack::init which was called 4 times, avg 30µs/call: # 4 times (88µs+30µs) by Test::Deep::MM::new at line 46 of Test/Deep/MM.pm, avg 30µs/call {
13 | 4 | 2µs |  |  | my $self = shift;
14 |  |  |  |  |
15 | 4 | 36µs | 4 | 10µs | $self->SUPER::init(@_); # spent 10µs making 4 calls to Test::Deep::MM::init, avg 3µs/call
16 |  |  |  |  |
17 | 4 | 34µs | 8 | 20µs | $self->setStack([]) unless $self->getStack; # spent 11µs making 4 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:28], avg 3µs/call # spent 9µs making 4 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 2µs/call
18 |  |  |  |  | }
19 |  |  |  |  |
20 |  |  |  |  | sub push
21 |  |  |  |  | # spent 124µs (92+32) within Test::Deep::Stack::push which was called 18 times, avg 7µs/call: # 18 times (92µs+32µs) by Test::Deep::descend at line 335 of Test/Deep.pm, avg 7µs/call {
22 | 18 | 5µs |  |  | my $self = shift;
23 |  |  |  |  |
24 | 18 | 71µs | 18 | 32µs | push(@{$self->getStack}, @_); # spent 32µs making 18 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 2µs/call
25 |  |  |  |  | }
26 |  |  |  |  |
27 |  |  |  |  | sub pop
28 |  |  |  |  | # spent 139µs (116+24) within Test::Deep::Stack::pop which was called 18 times, avg 8µs/call: # 18 times (116µs+24µs) by Test::Deep::descend at line 347 of Test/Deep.pm, avg 8µs/call {
29 | 18 | 6µs |  |  | my $self = shift;
30 |  |  |  |  |
31 | 18 | 58µs | 18 | 24µs | return pop @{$self->getStack}; # spent 24µs making 18 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 1µ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 54µs (41+13) within Test::Deep::Stack::getLast which was called 8 times, avg 7µs/call: # 8 times (41µs+13µs) by Test::Deep::Cmp::data at line 128 of Test/Deep/Cmp.pm, avg 7µs/call {
63 | 8 | 3µs |  |  | my $self = shift;
64 |  |  |  |  |
65 | 8 | 33µs | 8 | 13µs | return $self->getStack->[-1]; # spent 13µs making 8 calls to Test::Deep::MM::__ANON__[Test/Deep/MM.pm:25], avg 2µ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 | 2µs |  |  | 1;