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

Filename/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep/Shallow.pm
StatementsExecuted 47 statements in 283µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41120µs20µsTest::Deep::Shallow::::descendTest::Deep::Shallow::descend
11114µs28µsTest::Deep::::BEGIN@1.18 Test::Deep::BEGIN@1.18
11113µs18µsTest::Deep::::BEGIN@2.19 Test::Deep::BEGIN@2.19
11112µs57µsTest::Deep::Shallow::::BEGIN@8Test::Deep::Shallow::BEGIN@8
41112µs12µsTest::Deep::Shallow::::initTest::Deep::Shallow::init
1119µs23µsTest::Deep::Shallow::::BEGIN@6Test::Deep::Shallow::BEGIN@6
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1227µs242µs
# spent 28µs (14+14) within Test::Deep::BEGIN@1.18 which was called: # once (14µs+14µs) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep.pm:81] at line 1
use strict;
# spent 28µs making 1 call to Test::Deep::BEGIN@1.18 # spent 14µs making 1 call to strict::import
2233µs222µs
# spent 18µs (13+4) within Test::Deep::BEGIN@2.19 which was called: # once (13µs+4µs) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep.pm:81] at line 2
use warnings;
# spent 18µs making 1 call to Test::Deep::BEGIN@2.19 # spent 4µs making 1 call to warnings::import
3
4package Test::Deep::Shallow;
5
6228µs238µs
# spent 23µs (9+14) within Test::Deep::Shallow::BEGIN@6 which was called: # once (9µs+14µs) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep.pm:81] at line 6
use Test::Deep::Cmp;
# spent 23µs making 1 call to Test::Deep::Shallow::BEGIN@6 # spent 14µs making 1 call to Test::Deep::Cmp::import
7
82143µs2102µs
# spent 57µs (12+45) within Test::Deep::Shallow::BEGIN@8 which was called: # once (12µs+45µs) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep.pm:81] at line 8
use Scalar::Util qw( refaddr );
# spent 57µs making 1 call to Test::Deep::Shallow::BEGIN@8 # spent 45µs making 1 call to Exporter::import
9
10sub init
11
# spent 12µs within Test::Deep::Shallow::init which was called 4 times, avg 3µs/call: # 4 times (12µs+0s) by Test::Deep::Cmp::new at line 33 of Test/Deep/Cmp.pm, avg 3µs/call
{
1241µs my $self = shift;
13
1441µs my $val = shift;
15419µs $self->{val} = $val;
16}
17
18sub descend
19
# spent 20µs within Test::Deep::Shallow::descend which was called 4 times, avg 5µs/call: # 4 times (20µs+0s) by Test::Deep::descend at line 344 of Test/Deep.pm, avg 5µs/call
{
2042µs my $self = shift;
21
2242µs my $got = shift;
2343µs my $exp = $self->{val};
24
254700ns my $ok;
26
2746µs if (!defined $got and !defined $exp)
28 {
29 $ok = 1;
30 }
31 elsif (defined $got xor defined $exp)
32 {
33 $ok = 0;
34 }
35 elsif (ref $got and ref $exp)
36 {
37 $ok = refaddr($got) == refaddr($exp);
38 }
39 elsif (ref $got xor ref $exp)
40 {
41 $ok = 0;
42 }
43 else
44 {
4522µs $ok = $got eq $exp;
46 }
47
48414µs return $ok;
49}
50
5112µs1;