← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 05.Domain_and_Item.t
  Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:22:21 2010

File /usr/local/lib/perl5/5.10.1/Test/Deep/Shallow.pm
Statements Executed 140
Statement Execution Time 388µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
131144µs44µsTest::Deep::Shallow::::descendTest::Deep::Shallow::descend
131126µs26µsTest::Deep::Shallow::::initTest::Deep::Shallow::init
1119µs31µsTest::Deep::Shallow::::BEGIN@6Test::Deep::Shallow::BEGIN@6
1119µs48µsTest::Deep::Shallow::::BEGIN@8Test::Deep::Shallow::BEGIN@8
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1328µs226µsuse strict;
# spent 22µs making 1 call to Test::Deep::BEGIN@1 # spent 4µs making 1 call to strict::import
2368µs233µsuse warnings;
# spent 21µs making 1 call to Test::Deep::BEGIN@2 # spent 12µs making 1 call to warnings::import
3
4package Test::Deep::Shallow;
5
6333µs252µs
# spent 31µs (9+21) within Test::Deep::Shallow::BEGIN@6 which was called # once (9µs+21µs) by Test::Deep::__ANON__[/usr/local/lib/perl5/5.10.1/Test/Deep.pm:92] at line 6
use Test::Deep::Cmp;
# spent 31µs making 1 call to Test::Deep::Shallow::BEGIN@6 # spent 22µs making 1 call to Test::Deep::Cmp::import
7
83170µs287µs
# spent 48µs (9+39) within Test::Deep::Shallow::BEGIN@8 which was called # once (9µs+39µs) by Test::Deep::__ANON__[/usr/local/lib/perl5/5.10.1/Test/Deep.pm:92] at line 8
use Scalar::Util qw( refaddr );
# spent 48µs making 1 call to Test::Deep::Shallow::BEGIN@8 # spent 39µs making 1 call to Exporter::import
9
10sub init
11
# spent 26µs within Test::Deep::Shallow::init which was called 13 times, avg 2µs/call: # 13 times (26µs+0s) by Test::Deep::Cmp::new at line 32 of Test/Deep/Cmp.pm, avg 2µs/call
{
123938µs my $self = shift;
13
14 my $val = shift;
15 $self->{val} = $val;
16}
17
18sub descend
19
# spent 44µs within Test::Deep::Shallow::descend which was called 13 times, avg 3µs/call: # 13 times (44µs+0s) by Test::Deep::descend at line 312 of Test/Deep.pm, avg 3µs/call
{
208847µs my $self = shift;
21
22 my $got = shift;
23 my $exp = $self->{val};
24
25 my $ok;
26
27 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 {
45 $ok = $got eq $exp;
46 }
47
48 return $ok;
49}
50
5113µs1;