← 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
StatementsExecuted 111 statements in 774µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111454µs633µsTest::Deep::Stack::::BEGIN@9Test::Deep::Stack::BEGIN@9
1811116µs139µsTest::Deep::Stack::::popTest::Deep::Stack::pop
181192µs124µsTest::Deep::Stack::::pushTest::Deep::Stack::push
41188µs118µsTest::Deep::Stack::::initTest::Deep::Stack::init
81141µs54µsTest::Deep::Stack::::getLastTest::Deep::Stack::getLast
11115µs31µsTest::Deep::::BEGIN@1.1 Test::Deep::BEGIN@1.1
11110µs16µsTest::Deep::::BEGIN@2.2 Test::Deep::BEGIN@2.2
11110µs25µsTest::Deep::Stack::::BEGIN@7Test::Deep::Stack::BEGIN@7
1119µs38µ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
1234µs247µ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
2236µs223µ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
4package Test::Deep::Stack;
5
6226µs267µ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
7229µs240µ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
92400µs2724µ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
11sub 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
{
1342µs my $self = shift;
14
15436µs410µs $self->SUPER::init(@_);
# spent 10µs making 4 calls to Test::Deep::MM::init, avg 3µs/call
16
17434µs820µ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
20sub 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
{
22185µs my $self = shift;
23
241871µs1832µ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
27sub 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
{
29186µs my $self = shift;
30
311858µs1824µ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
34sub 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
61sub 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
{
6383µs my $self = shift;
64
65833µs813µ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
68sub incArrow
69{
70 my $self = shift;
71
72 my $a = $self->getArrow;
73 $self->setArrow($a + 1);
74
75 return $a;
76}
77
78sub length
79{
80 my $self = shift;
81
82 return @{$self->getStack} + 0;
83}
84
8512µs1;