Filename | /home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep/Shallow.pm |
Statements | Executed 47 statements in 283µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4 | 1 | 1 | 20µs | 20µs | descend | Test::Deep::Shallow::
1 | 1 | 1 | 14µs | 28µs | BEGIN@1.18 | Test::Deep::
1 | 1 | 1 | 13µs | 18µs | BEGIN@2.19 | Test::Deep::
1 | 1 | 1 | 12µs | 57µs | BEGIN@8 | Test::Deep::Shallow::
4 | 1 | 1 | 12µs | 12µs | init | Test::Deep::Shallow::
1 | 1 | 1 | 9µs | 23µs | BEGIN@6 | Test::Deep::Shallow::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 27µs | 2 | 42µ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 # spent 28µs making 1 call to Test::Deep::BEGIN@1.18
# spent 14µs making 1 call to strict::import |
2 | 2 | 33µs | 2 | 22µ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 # spent 18µs making 1 call to Test::Deep::BEGIN@2.19
# spent 4µs making 1 call to warnings::import |
3 | |||||
4 | package Test::Deep::Shallow; | ||||
5 | |||||
6 | 2 | 28µs | 2 | 38µ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 # spent 23µs making 1 call to Test::Deep::Shallow::BEGIN@6
# spent 14µs making 1 call to Test::Deep::Cmp::import |
7 | |||||
8 | 2 | 143µs | 2 | 102µ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 # spent 57µs making 1 call to Test::Deep::Shallow::BEGIN@8
# spent 45µs making 1 call to Exporter::import |
9 | |||||
10 | sub 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 | ||||
12 | 4 | 1µs | my $self = shift; | ||
13 | |||||
14 | 4 | 1µs | my $val = shift; | ||
15 | 4 | 19µs | $self->{val} = $val; | ||
16 | } | ||||
17 | |||||
18 | sub 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 | ||||
20 | 4 | 2µs | my $self = shift; | ||
21 | |||||
22 | 4 | 2µs | my $got = shift; | ||
23 | 4 | 3µs | my $exp = $self->{val}; | ||
24 | |||||
25 | 4 | 700ns | my $ok; | ||
26 | |||||
27 | 4 | 6µ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 | 2 | 2µs | $ok = $got eq $exp; | ||
46 | } | ||||
47 | |||||
48 | 4 | 14µs | return $ok; | ||
49 | } | ||||
50 | |||||
51 | 1 | 2µs | 1; |