| Filename | /home/doy/coding/src/MooseX-StrictConstructor-0.12/lib/MooseX/StrictConstructor/Role/Meta/Class.pm |
| Statements | Executed 299 statements in 5.91ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 46µs | 46µs | MooseX::StrictConstructor::Role::Meta::Class::BEGIN@2 |
| 1 | 1 | 1 | 45µs | 759µs | MooseX::StrictConstructor::Role::Meta::Class::BEGIN@37 |
| 1 | 1 | 1 | 40µs | 15.9ms | MooseX::StrictConstructor::Role::Meta::Class::BEGIN@12 |
| 1 | 1 | 1 | 39µs | 57µs | MooseX::StrictConstructor::Role::Meta::Class::BEGIN@6 |
| 1 | 1 | 1 | 38µs | 107µs | MooseX::StrictConstructor::Role::Meta::Class::BEGIN@7 |
| 1 | 1 | 1 | 25µs | 25µs | MooseX::StrictConstructor::Role::Meta::Class::BEGIN@10 |
| 1 | 1 | 1 | 23µs | 23µs | MooseX::StrictConstructor::Role::Meta::Class::BEGIN@9 |
| 0 | 0 | 0 | 0s | 0s | MooseX::StrictConstructor::Role::Meta::Class::__ANON__[:35] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package MooseX::StrictConstructor::Role::Meta::Class; | ||||
| 2 | # spent 46µs within MooseX::StrictConstructor::Role::Meta::Class::BEGIN@2 which was called:
# once (46µs+0s) by MooseX::StrictConstructor::BEGIN@13 at line 4 | ||||
| 3 | 1 | 27µs | $MooseX::StrictConstructor::Role::Meta::Class::VERSION = '0.12'; | ||
| 4 | 1 | 71µs | 1 | 46µs | } # spent 46µs making 1 call to MooseX::StrictConstructor::Role::Meta::Class::BEGIN@2 |
| 5 | |||||
| 6 | 3 | 93µs | 2 | 74µs | # spent 57µs (39+17) within MooseX::StrictConstructor::Role::Meta::Class::BEGIN@6 which was called:
# once (39µs+17µs) by MooseX::StrictConstructor::BEGIN@13 at line 6 # spent 57µs making 1 call to MooseX::StrictConstructor::Role::Meta::Class::BEGIN@6
# spent 17µs making 1 call to strict::import |
| 7 | 3 | 95µs | 2 | 175µs | # spent 107µs (38+68) within MooseX::StrictConstructor::Role::Meta::Class::BEGIN@7 which was called:
# once (38µs+68µs) by MooseX::StrictConstructor::BEGIN@13 at line 7 # spent 107µs making 1 call to MooseX::StrictConstructor::Role::Meta::Class::BEGIN@7
# spent 68µs making 1 call to warnings::import |
| 8 | |||||
| 9 | 3 | 110µs | 1 | 23µs | # spent 23µs within MooseX::StrictConstructor::Role::Meta::Class::BEGIN@9 which was called:
# once (23µs+0s) by MooseX::StrictConstructor::BEGIN@13 at line 9 # spent 23µs making 1 call to MooseX::StrictConstructor::Role::Meta::Class::BEGIN@9 |
| 10 | 3 | 91µs | 1 | 25µs | # spent 25µs within MooseX::StrictConstructor::Role::Meta::Class::BEGIN@10 which was called:
# once (25µs+0s) by MooseX::StrictConstructor::BEGIN@13 at line 10 # spent 25µs making 1 call to MooseX::StrictConstructor::Role::Meta::Class::BEGIN@10 |
| 11 | |||||
| 12 | 3 | 554µs | 2 | 31.7ms | # spent 15.9ms (40µs+15.8) within MooseX::StrictConstructor::Role::Meta::Class::BEGIN@12 which was called:
# once (40µs+15.8ms) by MooseX::StrictConstructor::BEGIN@13 at line 12 # spent 15.9ms making 1 call to MooseX::StrictConstructor::Role::Meta::Class::BEGIN@12
# spent 15.8ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456] |
| 13 | |||||
| 14 | around '_inline_BUILDALL' => sub { | ||||
| 15 | 37 | 139µs | my $orig = shift; | ||
| 16 | 37 | 111µs | my $self = shift; | ||
| 17 | |||||
| 18 | 37 | 391µs | 37 | 29.0ms | my @source = $self->$orig(); # spent 29.0ms making 37 calls to Moose::Meta::Class::_inline_BUILDALL, avg 782µs/call |
| 19 | |||||
| 20 | 41 | 913µs | 41 | 416µs | my @attrs = ( # spent 416µs making 41 calls to B::perlstring, avg 10µs/call |
| 21 | '__INSTANCE__ => 1,', | ||||
| 22 | map { B::perlstring($_) . ' => 1,' } | ||||
| 23 | 52 | 1.03ms | 52 | 305µs | grep {defined} # spent 305µs making 52 calls to Class::MOP::Mixin::AttributeCore::init_arg, avg 6µs/call |
| 24 | 37 | 1.12ms | 37 | 11.4ms | map { $_->init_arg() } $self->get_all_attributes() # spent 11.4ms making 37 calls to Class::MOP::Class::get_all_attributes, avg 308µs/call |
| 25 | ); | ||||
| 26 | |||||
| 27 | return ( | ||||
| 28 | 37 | 966µs | @source, | ||
| 29 | 'my %attrs = (' . join(' ', @attrs) . ');', | ||||
| 30 | 'my @bad = sort grep { !$attrs{$_} } keys %{ $params };', | ||||
| 31 | 'if (@bad) {', | ||||
| 32 | 'Carp::confess "Found unknown attribute(s) passed to the constructor: @bad";', | ||||
| 33 | '}', | ||||
| 34 | ); | ||||
| 35 | 1 | 22µs | 1 | 362µs | }; # spent 362µs making 1 call to Moose::Role::around |
| 36 | |||||
| 37 | 3 | 142µs | 2 | 1.47ms | # spent 759µs (45+714) within MooseX::StrictConstructor::Role::Meta::Class::BEGIN@37 which was called:
# once (45µs+714µs) by MooseX::StrictConstructor::BEGIN@13 at line 37 # spent 759µs making 1 call to MooseX::StrictConstructor::Role::Meta::Class::BEGIN@37
# spent 714µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:557] |
| 38 | |||||
| 39 | 1 | 27µs | 1; | ||
| 40 | |||||
| 41 | # ABSTRACT: A role to make immutable constructors strict | ||||
| 42 | |||||
| - - | |||||
| 45 | =pod | ||||
| 46 | |||||
| - - | |||||
| 86 | __END__ |