| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm |
| Statements | Executed 373 statements in 5.87ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 55µs | 55µs | MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@2 |
| 1 | 1 | 1 | 47µs | 727µs | MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@41 |
| 1 | 1 | 1 | 42µs | 14.6ms | MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@12 |
| 1 | 1 | 1 | 40µs | 59µs | MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@6 |
| 1 | 1 | 1 | 38µs | 107µs | MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@7 |
| 1 | 1 | 1 | 20µs | 20µs | MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@10 |
| 1 | 1 | 1 | 19µs | 19µs | MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@9 |
| 0 | 0 | 0 | 0s | 0s | MooseX::StrictConstructor::Role::Meta::Method::Constructor::__ANON__[:39] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package MooseX::StrictConstructor::Role::Meta::Method::Constructor; | ||||
| 2 | # spent 55µs within MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@2 which was called:
# once (55µs+0s) by MooseX::StrictConstructor::BEGIN@13 at line 4 | ||||
| 3 | 1 | 29µs | $MooseX::StrictConstructor::Role::Meta::Method::Constructor::VERSION = '0.11'; | ||
| 4 | 1 | 94µs | 1 | 55µs | } # spent 55µs making 1 call to MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@2 |
| 5 | |||||
| 6 | 3 | 95µs | 2 | 78µs | # spent 59µs (40+19) within MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@6 which was called:
# once (40µs+19µs) by MooseX::StrictConstructor::BEGIN@13 at line 6 # spent 59µs making 1 call to MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@6
# spent 19µs making 1 call to strict::import |
| 7 | 3 | 92µs | 2 | 176µs | # spent 107µs (38+69) within MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@7 which was called:
# once (38µs+69µs) by MooseX::StrictConstructor::BEGIN@13 at line 7 # spent 107µs making 1 call to MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@7
# spent 69µs making 1 call to warnings::import |
| 8 | |||||
| 9 | 3 | 78µs | 1 | 19µs | # spent 19µs within MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@9 which was called:
# once (19µs+0s) by MooseX::StrictConstructor::BEGIN@13 at line 9 # spent 19µs making 1 call to MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@9 |
| 10 | 3 | 114µs | 1 | 20µs | # spent 20µs within MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@10 which was called:
# once (20µs+0s) by MooseX::StrictConstructor::BEGIN@13 at line 10 # spent 20µs making 1 call to MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@10 |
| 11 | |||||
| 12 | 3 | 620µs | 2 | 29.2ms | # spent 14.6ms (42µs+14.6) within MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@12 which was called:
# once (42µs+14.6ms) by MooseX::StrictConstructor::BEGIN@13 at line 12 # spent 14.6ms making 1 call to MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@12
# spent 14.6ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456] |
| 13 | |||||
| 14 | around '_generate_BUILDALL' => sub { | ||||
| 15 | 352 | 4.55ms | my $orig = shift; | ||
| 16 | my $self = shift; | ||||
| 17 | |||||
| 18 | 37 | 40.5ms | my $source = $self->$orig(); # spent 40.5ms making 37 calls to Moose::Meta::Method::Constructor::_generate_BUILDALL, avg 1.09ms/call | ||
| 19 | $source .= ";\n" if $source; | ||||
| 20 | |||||
| 21 | 41 | 426µs | my @attrs = ( # spent 426µs making 41 calls to B::perlstring, avg 10µs/call | ||
| 22 | "__INSTANCE__ => 1,", | ||||
| 23 | map { B::perlstring($_) . ' => 1,' } | ||||
| 24 | 52 | 556µs | grep {defined} # spent 556µs making 52 calls to Class::MOP::Mixin::AttributeCore::init_arg, avg 11µs/call | ||
| 25 | 37 | 519µs | map { $_->init_arg() } @{ $self->_attributes() } # spent 519µs making 37 calls to Class::MOP::Method::Constructor::_attributes, avg 14µs/call | ||
| 26 | ); | ||||
| 27 | |||||
| 28 | $source .= <<"EOF"; | ||||
| 29 | my \%attrs = (@attrs); | ||||
| 30 | |||||
| 31 | my \@bad = sort grep { ! \$attrs{\$_} } keys \%{ \$params }; | ||||
| 32 | |||||
| 33 | if (\@bad) { | ||||
| 34 | Carp::confess "Found unknown attribute(s) passed to the constructor: \@bad"; | ||||
| 35 | } | ||||
| 36 | EOF | ||||
| 37 | |||||
| 38 | return $source; | ||||
| 39 | 1 | 22µs | 1 | 355µs | }; # spent 355µs making 1 call to Moose::Role::around |
| 40 | |||||
| 41 | 3 | 143µs | 2 | 1.41ms | # spent 727µs (47+680) within MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@41 which was called:
# once (47µs+680µs) by MooseX::StrictConstructor::BEGIN@13 at line 41 # spent 727µs making 1 call to MooseX::StrictConstructor::Role::Meta::Method::Constructor::BEGIN@41
# spent 680µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:557] |
| 42 | |||||
| 43 | 1 | 27µs | 1; | ||
| 44 | |||||
| 45 | # ABSTRACT: A role to make immutable constructors strict | ||||
| 46 | |||||
| - - | |||||
| 49 | =pod | ||||
| 50 | |||||
| - - | |||||
| 90 | __END__ |