| Filename | /home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Module.pm |
| Statements | Executed 491 statements in 6.91ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 67 | 2 | 2 | 4.78ms | 8.73ms | Class::MOP::Module::_instantiate_module |
| 1 | 1 | 1 | 66µs | 84µs | Class::MOP::Module::BEGIN@4 |
| 1 | 1 | 1 | 42µs | 115µs | Class::MOP::Module::BEGIN@64 |
| 1 | 1 | 1 | 42µs | 14.8ms | Class::MOP::Module::BEGIN@14 |
| 1 | 1 | 1 | 38µs | 107µs | Class::MOP::Module::BEGIN@5 |
| 1 | 1 | 1 | 37µs | 181µs | Class::MOP::Module::BEGIN@8 |
| 1 | 1 | 1 | 36µs | 189µs | Class::MOP::Module::BEGIN@7 |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Module::_new |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Module::create |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Module::identifier |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Class::MOP::Module; | ||||
| 3 | |||||
| 4 | 3 | 95µs | 2 | 102µs | # spent 84µs (66+18) within Class::MOP::Module::BEGIN@4 which was called:
# once (66µs+18µs) by base::import at line 4 # spent 84µs making 1 call to Class::MOP::Module::BEGIN@4
# spent 18µs making 1 call to strict::import |
| 5 | 3 | 102µs | 2 | 175µs | # spent 107µs (38+68) within Class::MOP::Module::BEGIN@5 which was called:
# once (38µs+68µs) by base::import at line 5 # spent 107µs making 1 call to Class::MOP::Module::BEGIN@5
# spent 68µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 3 | 102µs | 2 | 343µs | # spent 189µs (36+153) within Class::MOP::Module::BEGIN@7 which was called:
# once (36µs+153µs) by base::import at line 7 # spent 189µs making 1 call to Class::MOP::Module::BEGIN@7
# spent 153µs making 1 call to Exporter::import |
| 8 | 3 | 206µs | 2 | 325µs | # spent 181µs (37+144) within Class::MOP::Module::BEGIN@8 which was called:
# once (37µs+144µs) by base::import at line 8 # spent 181µs making 1 call to Class::MOP::Module::BEGIN@8
# spent 144µs making 1 call to Exporter::import |
| 9 | |||||
| 10 | 1 | 4µs | our $VERSION = '1.11'; | ||
| 11 | 1 | 63µs | $VERSION = eval $VERSION; # spent 10µs executing statements in string eval | ||
| 12 | 1 | 3µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 13 | |||||
| 14 | 3 | 904µs | 2 | 14.8ms | # spent 14.8ms (42µs+14.7) within Class::MOP::Module::BEGIN@14 which was called:
# once (42µs+14.7ms) by base::import at line 14 # spent 14.8ms making 1 call to Class::MOP::Module::BEGIN@14
# spent 14.7ms making 1 call to base::import, recursion: max depth 2, sum of overlapping time 14.7ms |
| 15 | |||||
| 16 | sub _new { | ||||
| 17 | my $class = shift; | ||||
| 18 | return Class::MOP::Class->initialize($class)->new_object(@_) | ||||
| 19 | if $class ne __PACKAGE__; | ||||
| 20 | |||||
| 21 | my $params = @_ == 1 ? $_[0] : {@_}; | ||||
| 22 | return bless { | ||||
| 23 | |||||
| 24 | # from Class::MOP::Package | ||||
| 25 | package => $params->{package}, | ||||
| 26 | namespace => \undef, | ||||
| 27 | |||||
| 28 | # attributes | ||||
| 29 | version => \undef, | ||||
| 30 | authority => \undef | ||||
| 31 | } => $class; | ||||
| 32 | } | ||||
| 33 | |||||
| 34 | sub version { | ||||
| 35 | my $self = shift; | ||||
| 36 | ${$self->get_or_add_package_symbol('$VERSION')}; | ||||
| 37 | } | ||||
| 38 | |||||
| 39 | sub authority { | ||||
| 40 | my $self = shift; | ||||
| 41 | ${$self->get_or_add_package_symbol('$AUTHORITY')}; | ||||
| 42 | } | ||||
| 43 | |||||
| 44 | sub identifier { | ||||
| 45 | my $self = shift; | ||||
| 46 | join '-' => ( | ||||
| 47 | $self->name, | ||||
| 48 | ($self->version || ()), | ||||
| 49 | ($self->authority || ()), | ||||
| 50 | ); | ||||
| 51 | } | ||||
| 52 | |||||
| 53 | sub create { | ||||
| 54 | confess "The Class::MOP::Module->create method has been made a private object method.\n"; | ||||
| 55 | } | ||||
| 56 | |||||
| 57 | # spent 8.73ms (4.78+3.96) within Class::MOP::Module::_instantiate_module which was called 67 times, avg 130µs/call:
# 42 times (3.18ms+2.49ms) by Moose::Meta::Role::create at line 545 of Moose/Meta/Role.pm, avg 135µs/call
# 25 times (1.59ms+1.46ms) by Class::MOP::Class::create at line 515 of Class/MOP/Class.pm, avg 122µs/call | ||||
| 58 | 67 | 548µs | my($self, $version, $authority) = @_; | ||
| 59 | 67 | 1.34ms | 67 | 366µs | my $package_name = $self->name; # spent 366µs making 67 calls to Class::MOP::Package::name, avg 5µs/call |
| 60 | |||||
| 61 | 67 | 706µs | 67 | 3.59ms | Class::MOP::_is_valid_class_name($package_name) # spent 3.59ms making 67 calls to Class::MOP::_is_valid_class_name, avg 54µs/call |
| 62 | || confess "creation of $package_name failed: invalid package name"; | ||||
| 63 | |||||
| 64 | 3 | 231µs | 2 | 188µs | # spent 115µs (42+73) within Class::MOP::Module::BEGIN@64 which was called:
# once (42µs+73µs) by base::import at line 64 # spent 115µs making 1 call to Class::MOP::Module::BEGIN@64
# spent 73µs making 1 call to strict::unimport |
| 65 | 67 | 1.47ms | scalar %{ $package_name . '::' }; # touch the stash | ||
| 66 | 67 | 152µs | ${ $package_name . '::VERSION' } = $version if defined $version; | ||
| 67 | 67 | 130µs | ${ $package_name . '::AUTHORITY' } = $authority if defined $authority; | ||
| 68 | |||||
| 69 | 67 | 841µs | return; | ||
| 70 | } | ||||
| 71 | |||||
| 72 | 1 | 11µs | 1; | ||
| 73 | |||||
| 74 | __END__ |