| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP/Module.pm |
| Statements | Executed 484 statements in 6.87ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 66 | 2 | 2 | 4.62ms | 8.60ms | Class::MOP::Module::_instantiate_module |
| 1 | 1 | 1 | 86µs | 104µs | Class::MOP::Module::BEGIN@4 |
| 1 | 1 | 1 | 45µs | 132µs | Class::MOP::Module::BEGIN@5 |
| 1 | 1 | 1 | 42µs | 113µs | Class::MOP::Module::BEGIN@64 |
| 1 | 1 | 1 | 40µs | 11.1ms | Class::MOP::Module::BEGIN@14 |
| 1 | 1 | 1 | 37µs | 197µs | Class::MOP::Module::BEGIN@7 |
| 1 | 1 | 1 | 36µs | 166µs | Class::MOP::Module::BEGIN@8 |
| 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 | 100µs | 2 | 123µs | # spent 104µs (86+18) within Class::MOP::Module::BEGIN@4 which was called:
# once (86µs+18µs) by base::import at line 4 # spent 104µs making 1 call to Class::MOP::Module::BEGIN@4
# spent 18µs making 1 call to strict::import |
| 5 | 3 | 133µs | 2 | 220µs | # spent 132µs (45+87) within Class::MOP::Module::BEGIN@5 which was called:
# once (45µs+87µs) by base::import at line 5 # spent 132µs making 1 call to Class::MOP::Module::BEGIN@5
# spent 87µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 3 | 105µs | 2 | 357µs | # spent 197µs (37+160) within Class::MOP::Module::BEGIN@7 which was called:
# once (37µs+160µs) by base::import at line 7 # spent 197µs making 1 call to Class::MOP::Module::BEGIN@7
# spent 160µs making 1 call to Exporter::import |
| 8 | 3 | 205µs | 2 | 295µs | # spent 166µs (36+130) within Class::MOP::Module::BEGIN@8 which was called:
# once (36µs+130µs) by base::import at line 8 # spent 166µs making 1 call to Class::MOP::Module::BEGIN@8
# spent 130µs making 1 call to Exporter::import |
| 9 | |||||
| 10 | 1 | 4µs | our $VERSION = '1.11'; | ||
| 11 | 1 | 57µs | $VERSION = eval $VERSION; # spent 10µs executing statements in string eval | ||
| 12 | 1 | 4µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 13 | |||||
| 14 | 3 | 941µs | 2 | 11.1ms | # spent 11.1ms (40µs+11.0) within Class::MOP::Module::BEGIN@14 which was called:
# once (40µs+11.0ms) by base::import at line 14 # spent 11.1ms making 1 call to Class::MOP::Module::BEGIN@14
# spent 11.0ms making 1 call to base::import, recursion: max depth 2, sum of overlapping time 11.0ms |
| 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({ sigil => '$', type => 'SCALAR', name => 'VERSION' })}; | ||||
| 37 | } | ||||
| 38 | |||||
| 39 | sub authority { | ||||
| 40 | my $self = shift; | ||||
| 41 | ${$self->get_or_add_package_symbol({ sigil => '$', type => 'SCALAR', name => '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.60ms (4.62+3.98) within Class::MOP::Module::_instantiate_module which was called 66 times, avg 130µs/call:
# 42 times (3.10ms+2.50ms) by Moose::Meta::Role::create at line 545 of Moose/Meta/Role.pm, avg 133µs/call
# 24 times (1.52ms+1.48ms) by Class::MOP::Class::create at line 527 of Class/MOP/Class.pm, avg 125µs/call | ||||
| 58 | 66 | 501µs | my($self, $version, $authority) = @_; | ||
| 59 | 66 | 1.31ms | 66 | 364µs | my $package_name = $self->name; # spent 364µs making 66 calls to Class::MOP::Package::name, avg 6µs/call |
| 60 | |||||
| 61 | 66 | 684µs | 66 | 3.62ms | Class::MOP::_is_valid_class_name($package_name) # spent 3.62ms making 66 calls to Class::MOP::_is_valid_class_name, avg 55µs/call |
| 62 | || confess "creation of $package_name failed: invalid package name"; | ||||
| 63 | |||||
| 64 | 3 | 256µs | 2 | 183µs | # spent 113µs (42+71) within Class::MOP::Module::BEGIN@64 which was called:
# once (42µs+71µs) by base::import at line 64 # spent 113µs making 1 call to Class::MOP::Module::BEGIN@64
# spent 71µs making 1 call to strict::unimport |
| 65 | 66 | 1.49ms | scalar %{ $package_name . '::' }; # touch the stash | ||
| 66 | 66 | 140µs | ${ $package_name . '::VERSION' } = $version if defined $version; | ||
| 67 | 66 | 133µs | ${ $package_name . '::AUTHORITY' } = $authority if defined $authority; | ||
| 68 | |||||
| 69 | 66 | 797µs | return; | ||
| 70 | } | ||||
| 71 | |||||
| 72 | 1 | 12µs | 1; | ||
| 73 | |||||
| 74 | __END__ |