| Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Test/Deep/MM.pm |
| Statements | Executed 39 statements in 365µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 57µs | 62µs | Test::Deep::MM::import |
| 1 | 1 | 1 | 12µs | 14µs | Test::Deep::Stack::BEGIN@1 |
| 1 | 1 | 1 | 8µs | 22µs | Test::Deep::MM::BEGIN@16 |
| 1 | 1 | 1 | 6µs | 14µs | Test::Deep::Stack::BEGIN@2 |
| 1 | 1 | 1 | 6µs | 14µs | Test::Deep::MM::BEGIN@31 |
| 4 | 1 | 1 | 4µs | 4µs | Test::Deep::MM::CORE:match (opcode) |
| 0 | 0 | 0 | 0s | 0s | Test::Deep::MM::__ANON__[:25] |
| 0 | 0 | 0 | 0s | 0s | Test::Deep::MM::__ANON__[:28] |
| 0 | 0 | 0 | 0s | 0s | Test::Deep::MM::init |
| 0 | 0 | 0 | 0s | 0s | Test::Deep::MM::new |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 3 | 16µs | 2 | 15µs | # spent 14µs (12+2) within Test::Deep::Stack::BEGIN@1 which was called:
# once (12µs+2µs) by Test::Deep::Stack::BEGIN@9 at line 1 # spent 14µs making 1 call to Test::Deep::Stack::BEGIN@1
# spent 2µs making 1 call to strict::import |
| 2 | 3 | 65µs | 2 | 22µs | # spent 14µs (6+8) within Test::Deep::Stack::BEGIN@2 which was called:
# once (6µs+8µs) by Test::Deep::Stack::BEGIN@9 at line 2 # spent 14µs making 1 call to Test::Deep::Stack::BEGIN@2
# spent 8µs making 1 call to warnings::import |
| 3 | |||||
| 4 | package Test::Deep::MM; | ||||
| 5 | |||||
| 6 | sub import | ||||
| 7 | # spent 62µs (57+5) within Test::Deep::MM::import which was called:
# once (57µs+5µs) by Test::Deep::Stack::BEGIN@9 at line 9 of Test/Deep/Stack.pm | ||||
| 8 | 4 | 7µs | my $self = shift; | ||
| 9 | |||||
| 10 | my ($pkg) = caller(); | ||||
| 11 | my $mpkg = $pkg."::Methods"; | ||||
| 12 | foreach my $attr (@_) | ||||
| 13 | { | ||||
| 14 | 16 | 34µs | 4 | 4µs | if ($attr =~ /^[a-z]/) # spent 4µs making 4 calls to Test::Deep::MM::CORE:match, avg 1µs/call |
| 15 | { | ||||
| 16 | 3 | 99µs | 2 | 37µs | # spent 22µs (8+15) within Test::Deep::MM::BEGIN@16 which was called:
# once (8µs+15µs) by Test::Deep::Stack::BEGIN@9 at line 16 # spent 22µs making 1 call to Test::Deep::MM::BEGIN@16
# spent 14µs making 1 call to strict::unimport |
| 17 | *{$mpkg."::$attr"} = \&{$attr}; | ||||
| 18 | } | ||||
| 19 | else | ||||
| 20 | { | ||||
| 21 | my $get_name = $mpkg."::get$attr"; | ||||
| 22 | my $set_name = $mpkg."::set$attr"; | ||||
| 23 | my $get_sub = sub { | ||||
| 24 | return $_[0]->{$attr}; | ||||
| 25 | }; | ||||
| 26 | my $set_sub = sub { | ||||
| 27 | return $_[0]->{$attr} = $_[1]; | ||||
| 28 | }; | ||||
| 29 | |||||
| 30 | { | ||||
| 31 | 3 | 120µs | 2 | 22µs | # spent 14µs (6+8) within Test::Deep::MM::BEGIN@31 which was called:
# once (6µs+8µs) by Test::Deep::Stack::BEGIN@9 at line 31 # spent 14µs making 1 call to Test::Deep::MM::BEGIN@31
# spent 8µs making 1 call to strict::unimport |
| 32 | 6 | 23µs | *$get_name = $get_sub; | ||
| 33 | *$set_name = $set_sub; | ||||
| 34 | push(@{$pkg."::ISA"}, $mpkg); | ||||
| 35 | } | ||||
| 36 | } | ||||
| 37 | } | ||||
| 38 | } | ||||
| 39 | |||||
| 40 | sub new | ||||
| 41 | { | ||||
| 42 | my $pkg = shift; | ||||
| 43 | |||||
| 44 | my $self = bless {}, $pkg; | ||||
| 45 | |||||
| 46 | $self->init(@_); | ||||
| 47 | |||||
| 48 | return $self; | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | sub init | ||||
| 52 | { | ||||
| 53 | my $self = shift; | ||||
| 54 | |||||
| 55 | while (@_) | ||||
| 56 | { | ||||
| 57 | my $name = shift || confess("No name"); | ||||
| 58 | |||||
| 59 | my $method = "set$name"; | ||||
| 60 | $self->$method(shift); | ||||
| 61 | } | ||||
| 62 | } | ||||
| 63 | |||||
| 64 | 1 | 2µs | 1; | ||
# spent 4µs within Test::Deep::MM::CORE:match which was called 4 times, avg 1µs/call:
# 4 times (4µs+0s) by Test::Deep::MM::import at line 14, avg 1µs/call |