| Filename | /Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Meta/Method/Constructor.pm |
| Statements | Executed 188 statements in 1.65ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 16 | 1 | 1 | 1.07ms | 115ms | Moose::Meta::Method::Constructor::new |
| 16 | 1 | 1 | 136µs | 114ms | Moose::Meta::Method::Constructor::_initialize_body |
| 1 | 1 | 1 | 18µs | 36µs | Moose::Meta::Method::Constructor::BEGIN@4 |
| 1 | 1 | 1 | 12µs | 212µs | Moose::Meta::Method::Constructor::BEGIN@12 |
| 1 | 1 | 1 | 12µs | 47µs | Moose::Meta::Method::Constructor::BEGIN@7 |
| 1 | 1 | 1 | 11µs | 17µs | Moose::Meta::Method::Constructor::BEGIN@5 |
| 1 | 1 | 1 | 11µs | 63µs | Moose::Meta::Method::Constructor::BEGIN@9 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Meta::Method::Constructor; | ||||
| 2 | 1 | 900ns | our $VERSION = '2.1403'; | ||
| 3 | |||||
| 4 | 2 | 37µs | 2 | 54µs | # spent 36µs (18+18) within Moose::Meta::Method::Constructor::BEGIN@4 which was called:
# once (18µs+18µs) by Moose::Meta::Class::BEGIN@16 at line 4 # spent 36µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@4
# spent 18µs making 1 call to strict::import |
| 5 | 2 | 37µs | 2 | 22µs | # spent 17µs (11+6) within Moose::Meta::Method::Constructor::BEGIN@5 which was called:
# once (11µs+6µs) by Moose::Meta::Class::BEGIN@16 at line 5 # spent 17µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@5
# spent 6µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 2 | 42µs | 2 | 82µs | # spent 47µs (12+35) within Moose::Meta::Method::Constructor::BEGIN@7 which was called:
# once (12µs+35µs) by Moose::Meta::Class::BEGIN@16 at line 7 # spent 47µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@7
# spent 35µs making 1 call to Exporter::import |
| 8 | |||||
| 9 | 2 | 13µs | # spent 63µs (11+53) within Moose::Meta::Method::Constructor::BEGIN@9 which was called:
# once (11µs+53µs) by Moose::Meta::Class::BEGIN@16 at line 10 | ||
| 10 | 1 | 32µs | 2 | 116µs | 'Class::MOP::Method::Constructor'; # spent 63µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@9
# spent 53µs making 1 call to parent::import |
| 11 | |||||
| 12 | 2 | 281µs | 2 | 411µs | # spent 212µs (12+199) within Moose::Meta::Method::Constructor::BEGIN@12 which was called:
# once (12µs+199µs) by Moose::Meta::Class::BEGIN@16 at line 12 # spent 212µs making 1 call to Moose::Meta::Method::Constructor::BEGIN@12
# spent 199µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] |
| 13 | |||||
| 14 | # spent 115ms (1.07+114) within Moose::Meta::Method::Constructor::new which was called 16 times, avg 7.16ms/call:
# 16 times (1.07ms+114ms) by Class::MOP::Class::_inline_constructor at line 1453 of Class/MOP/Class.pm, avg 7.16ms/call | ||||
| 15 | 144 | 1.08ms | my $class = shift; | ||
| 16 | my %options = @_; | ||||
| 17 | |||||
| 18 | my $meta = $options{metaclass}; | ||||
| 19 | |||||
| 20 | (ref $options{options} eq 'HASH') | ||||
| 21 | || throw_exception( MustPassAHashOfOptions => params => \%options, | ||||
| 22 | class => $class | ||||
| 23 | ); | ||||
| 24 | |||||
| 25 | ($options{package_name} && $options{name}) | ||||
| 26 | || throw_exception( MustSupplyPackageNameAndName => params => \%options, | ||||
| 27 | class => $class | ||||
| 28 | ); | ||||
| 29 | |||||
| 30 | my $self = bless { | ||||
| 31 | 'body' => undef, | ||||
| 32 | 'package_name' => $options{package_name}, | ||||
| 33 | 'name' => $options{name}, | ||||
| 34 | 'options' => $options{options}, | ||||
| 35 | 'associated_metaclass' => $meta, | ||||
| 36 | 'definition_context' => $options{definition_context}, | ||||
| 37 | '_expected_method_class' => $options{_expected_method_class} || 'Moose::Object', | ||||
| 38 | } => $class; | ||||
| 39 | |||||
| 40 | # we don't want this creating | ||||
| 41 | # a cycle in the code, if not | ||||
| 42 | # needed | ||||
| 43 | 16 | 18µs | weaken($self->{'associated_metaclass'}); # spent 18µs making 16 calls to Scalar::Util::weaken, avg 1µs/call | ||
| 44 | |||||
| 45 | 16 | 114ms | $self->_initialize_body; # spent 114ms making 16 calls to Moose::Meta::Method::Constructor::_initialize_body, avg 7.10ms/call | ||
| 46 | |||||
| 47 | return $self; | ||||
| 48 | } | ||||
| 49 | |||||
| 50 | ## method | ||||
| 51 | |||||
| 52 | # spent 114ms (136µs+113) within Moose::Meta::Method::Constructor::_initialize_body which was called 16 times, avg 7.10ms/call:
# 16 times (136µs+113ms) by Moose::Meta::Method::Constructor::new at line 45, avg 7.10ms/call | ||||
| 53 | 32 | 127µs | my $self = shift; | ||
| 54 | 16 | 113ms | $self->{'body'} = $self->_generate_constructor_method_inline; # spent 113ms making 16 calls to Class::MOP::Method::Constructor::_generate_constructor_method_inline, avg 7.09ms/call | ||
| 55 | } | ||||
| 56 | |||||
| 57 | 1 | 4µs | 1; | ||
| 58 | |||||
| 59 | # ABSTRACT: Method Meta Object for constructors | ||||
| 60 | |||||
| 61 | __END__ |