| Filename | /home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep/Shallow.pm |
| Statements | Executed 351 statements in 2.88ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 36 | 1 | 1 | 779µs | 779µs | Test::Deep::Shallow::init |
| 36 | 1 | 1 | 751µs | 751µs | Test::Deep::Shallow::descend |
| 1 | 1 | 1 | 68µs | 84µs | Test::Deep::BEGIN@1.13 |
| 1 | 1 | 1 | 30µs | 57µs | Test::Deep::BEGIN@2.14 |
| 1 | 1 | 1 | 30µs | 180µs | Test::Deep::Shallow::BEGIN@8 |
| 1 | 1 | 1 | 28µs | 112µs | Test::Deep::Shallow::BEGIN@6 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 2 | 103µs | 2 | 101µs | # spent 84µs (68+17) within Test::Deep::BEGIN@1.13 which was called:
# once (68µs+17µs) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep.pm:80] at line 1 # spent 84µs making 1 call to Test::Deep::BEGIN@1.13
# spent 17µs making 1 call to strict::import |
| 2 | 2 | 128µs | 2 | 84µs | # spent 57µs (30+27) within Test::Deep::BEGIN@2.14 which was called:
# once (30µs+27µs) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep.pm:80] at line 2 # spent 57µs making 1 call to Test::Deep::BEGIN@2.14
# spent 27µs making 1 call to warnings::import |
| 3 | |||||
| 4 | package Test::Deep::Shallow; | ||||
| 5 | |||||
| 6 | 2 | 123µs | 2 | 195µs | # spent 112µs (28+83) within Test::Deep::Shallow::BEGIN@6 which was called:
# once (28µs+83µs) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep.pm:80] at line 6 # spent 112µs making 1 call to Test::Deep::Shallow::BEGIN@6
# spent 83µs making 1 call to Test::Deep::Cmp::import |
| 7 | |||||
| 8 | 2 | 783µs | 2 | 330µs | # spent 180µs (30+150) within Test::Deep::Shallow::BEGIN@8 which was called:
# once (30µs+150µs) by Test::Deep::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep.pm:80] at line 8 # spent 180µs making 1 call to Test::Deep::Shallow::BEGIN@8
# spent 150µs making 1 call to Exporter::import |
| 9 | |||||
| 10 | sub init | ||||
| 11 | # spent 779µs within Test::Deep::Shallow::init which was called 36 times, avg 22µs/call:
# 36 times (779µs+0s) by Test::Deep::Cmp::new at line 33 of Test/Deep/Cmp.pm, avg 22µs/call | ||||
| 12 | 36 | 49µs | my $self = shift; | ||
| 13 | |||||
| 14 | 36 | 131µs | my $val = shift; | ||
| 15 | 36 | 670µs | $self->{val} = $val; | ||
| 16 | } | ||||
| 17 | |||||
| 18 | sub descend | ||||
| 19 | # spent 751µs within Test::Deep::Shallow::descend which was called 36 times, avg 21µs/call:
# 36 times (751µs+0s) by Test::Deep::descend at line 328 of Test/Deep.pm, avg 21µs/call | ||||
| 20 | 36 | 47µs | my $self = shift; | ||
| 21 | |||||
| 22 | 36 | 44µs | my $got = shift; | ||
| 23 | 36 | 85µs | my $exp = $self->{val}; | ||
| 24 | |||||
| 25 | 36 | 25µs | my $ok; | ||
| 26 | |||||
| 27 | 36 | 146µ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 | 18 | 156µs | $ok = $got eq $exp; | ||
| 46 | } | ||||
| 47 | |||||
| 48 | 36 | 376µs | return $ok; | ||
| 49 | } | ||||
| 50 | |||||
| 51 | 1 | 9µs | 1; |