Profile of /usr/local/lib/perl5/5.10.1/Test/Deep/Shallow.pm

← 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:23:06 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
--- | --- | --- | --- | --- | ---
13 | 1 | 1 | 44µs | 44µs | Test::Deep::Shallow::::descendTest::Deep::Shallow::descend
13 | 1 | 1 | 26µs | 26µs | Test::Deep::Shallow::::initTest::Deep::Shallow::init
1 | 1 | 1 | 9µs | 31µs | Test::Deep::Shallow::::BEGIN@6Test::Deep::Shallow::BEGIN@6
1 | 1 | 1 | 9µs | 48µs | Test::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
--- | --- | --- | --- | --- | ---
1 | 3 | 28µs | 2 | 26µs | use strict; # spent 22µs making 1 call to Test::Deep::BEGIN@1 # spent 4µs making 1 call to strict::import
2 | 3 | 68µs | 2 | 33µs | use warnings; # spent 21µs making 1 call to Test::Deep::BEGIN@2 # spent 12µs making 1 call to warnings::import
3 |  |  |  |  |
4 |  |  |  |  | package Test::Deep::Shallow;
5 |  |  |  |  |
6 | 3 | 33µs | 2 | 52µ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 |  |  |  |  |
8 | 3 | 170µs | 2 | 87µ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 |  |  |  |  |
10 |  |  |  |  | sub 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 {
12 | 13 | 1µs |  |  | my $self = shift;
13 |  |  |  |  |
14 | 13 | 2µs |  |  | my $val = shift;
15 | 13 | 35µs |  |  | $self->{val} = $val;
16 |  |  |  |  | }
17 |  |  |  |  |
18 |  |  |  |  | sub 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 {
20 | 13 | 2µs |  |  | my $self = shift;
21 |  |  |  |  |
22 | 13 | 2µs |  |  | my $got = shift;
23 | 13 | 5µs |  |  | my $exp = $self->{val};
24 |  |  |  |  |
25 | 13 | 1µs |  |  | my $ok;
26 |  |  |  |  |
27 | 13 | 9µ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 |  |  |  |  | {
45 | 10 | 4µs |  |  | $ok = $got eq $exp;
46 |  |  |  |  | }
47 |  |  |  |  |
48 | 13 | 25µs |  |  | return $ok;
49 |  |  |  |  | }
50 |  |  |  |  |
51 | 1 | 3µs |  |  | 1;