File | /usr/local/lib/perl5/5.10.1/Test/Deep/Shallow.pm |
Statements Executed | 140 |
Statement Execution Time | 388µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
13 | 1 | 1 | 44µs | 44µs | descend | Test::Deep::Shallow::
13 | 1 | 1 | 26µs | 26µs | init | Test::Deep::Shallow::
1 | 1 | 1 | 9µs | 31µs | BEGIN@6 | Test::Deep::Shallow::
1 | 1 | 1 | 9µs | 48µs | BEGIN@8 | Test::Deep::Shallow::
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 # 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 # 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 | 39 | 38µs | my $self = shift; | ||
13 | |||||
14 | my $val = shift; | ||||
15 | $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 | 88 | 47µ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 | |||||
51 | 1 | 3µs | 1; |