| Filename | /home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Mixin/AttributeCore.pm |
| Statements | Executed 20176 statements in 217ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 2786 | 6 | 6 | 80.3ms | 154ms | Class::MOP::Mixin::AttributeCore::default (recurses: max depth 1, inclusive time 1.39ms) |
| 2477 | 3 | 3 | 37.7ms | 37.7ms | Class::MOP::Mixin::AttributeCore::is_default_a_coderef |
| 1 | 1 | 1 | 107µs | 175µs | Class::MOP::Mixin::AttributeCore::BEGIN@4 |
| 1 | 1 | 1 | 77µs | 111µs | Class::MOP::Mixin::AttributeCore::has_read_method |
| 1 | 1 | 1 | 68µs | 86µs | Class::MOP::Mixin::AttributeCore::BEGIN@3 |
| 1 | 1 | 1 | 45µs | 1.69ms | Class::MOP::Mixin::AttributeCore::BEGIN@12 |
| 1 | 1 | 1 | 40µs | 199µs | Class::MOP::Mixin::AttributeCore::BEGIN@10 |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Mixin::AttributeCore::has_write_method |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Class::MOP::Mixin::AttributeCore; | ||||
| 2 | |||||
| 3 | 3 | 98µs | 2 | 105µs | # spent 86µs (68+18) within Class::MOP::Mixin::AttributeCore::BEGIN@3 which was called:
# once (68µs+18µs) by Class::MOP::BEGIN@16 at line 3 # spent 86µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@3
# spent 18µs making 1 call to strict::import |
| 4 | 3 | 222µs | 2 | 243µs | # spent 175µs (107+68) within Class::MOP::Mixin::AttributeCore::BEGIN@4 which was called:
# once (107µs+68µs) by Class::MOP::BEGIN@16 at line 4 # spent 175µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@4
# spent 68µs making 1 call to warnings::import |
| 5 | |||||
| 6 | 1 | 4µs | our $VERSION = '1.11'; | ||
| 7 | 1 | 60µs | $VERSION = eval $VERSION; # spent 11µs executing statements in string eval | ||
| 8 | 1 | 3µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 9 | |||||
| 10 | 3 | 104µs | 2 | 358µs | # spent 199µs (40+159) within Class::MOP::Mixin::AttributeCore::BEGIN@10 which was called:
# once (40µs+159µs) by Class::MOP::BEGIN@16 at line 10 # spent 199µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@10
# spent 159µs making 1 call to Exporter::import |
| 11 | |||||
| 12 | 3 | 1.44ms | 2 | 1.69ms | # spent 1.69ms (45µs+1.65) within Class::MOP::Mixin::AttributeCore::BEGIN@12 which was called:
# once (45µs+1.65ms) by Class::MOP::BEGIN@16 at line 12 # spent 1.69ms making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@12
# spent 1.65ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 1.65ms |
| 13 | |||||
| 14 | 258 | 3.76ms | sub has_accessor { defined $_[0]->{'accessor'} } | ||
| 15 | 258 | 3.69ms | sub has_reader { defined $_[0]->{'reader'} } | ||
| 16 | 257 | 3.87ms | sub has_writer { defined $_[0]->{'writer'} } | ||
| 17 | 265 | 3.71ms | sub has_predicate { defined $_[0]->{'predicate'} } | ||
| 18 | 257 | 3.34ms | sub has_clearer { defined $_[0]->{'clearer'} } | ||
| 19 | 298 | 3.99ms | sub has_builder { defined $_[0]->{'builder'} } | ||
| 20 | sub has_init_arg { defined $_[0]->{'init_arg'} } | ||||
| 21 | 465 | 6.32ms | sub has_default { exists $_[0]->{'default'} } | ||
| 22 | 4454 | 60.4ms | sub has_initializer { defined $_[0]->{'initializer'} } | ||
| 23 | sub has_insertion_order { defined $_[0]->{'insertion_order'} } | ||||
| 24 | |||||
| 25 | 212 | 2.95ms | sub _set_insertion_order { $_[0]->{'insertion_order'} = $_[1] } | ||
| 26 | |||||
| 27 | 1 | 56µs | 2 | 35µs | # spent 111µs (77+35) within Class::MOP::Mixin::AttributeCore::has_read_method which was called:
# once (77µs+35µs) by Moose::Meta::Method::Delegation::_get_delegate_accessor at line 125 of Moose/Meta/Method/Delegation.pm # spent 17µs making 1 call to Class::MOP::Mixin::AttributeCore::has_accessor
# spent 17µs making 1 call to Class::MOP::Mixin::AttributeCore::has_reader |
| 28 | sub has_write_method { $_[0]->has_writer || $_[0]->has_accessor } | ||||
| 29 | |||||
| 30 | # spent 37.7ms within Class::MOP::Mixin::AttributeCore::is_default_a_coderef which was called 2477 times, avg 15µs/call:
# 2293 times (34.4ms+0s) by Class::MOP::Mixin::AttributeCore::default at line 43, avg 15µs/call
# 151 times (2.64ms+0s) by Class::MOP::Class::_inline_default_value at line 721 of Class/MOP/Class.pm, avg 17µs/call
# 33 times (684µs+0s) by Class::MOP::Attribute::new at line 47 of Class/MOP/Attribute.pm, avg 21µs/call | ||||
| 31 | # Uber hack because it is called from CMOP::Attribute constructor as | ||||
| 32 | # $class->is_default_a_coderef(\%options) | ||||
| 33 | 6512 | 49.1ms | my ($value) = ref $_[0] ? $_[0]->{'default'} : $_[1]->{'default'}; | ||
| 34 | |||||
| 35 | return unless ref($value); | ||||
| 36 | |||||
| 37 | return ref($value) eq 'CODE' | ||||
| 38 | || ( blessed($value) && $value->isa('Class::MOP::Method') ); | ||||
| 39 | } | ||||
| 40 | |||||
| 41 | # spent 154ms (80.3+73.5) within Class::MOP::Mixin::AttributeCore::default which was called 2786 times, avg 55µs/call:
# 2283 times (72.9ms+47.7ms) by Class::MOP::Attribute::initialize_instance_slot at line 115 of Class/MOP/Attribute.pm, avg 53µs/call
# 267 times (3.53ms+0s) by Class::MOP::Method::Constructor::_eval_environment at line 97 of Class/MOP/Method/Constructor.pm, avg 13µs/call
# 132 times (1.94ms+0s) by Moose::Meta::Method::Constructor::_eval_environment at line 60 of Moose/Meta/Method/Constructor.pm, avg 15µs/call
# 94 times (1.62ms+0s) by Class::MOP::Class::_immutable_metaclass at line 1368 of Class/MOP/Class.pm, avg 17µs/call
# 8 times (225µs+109µs) by Moose::Meta::Attribute::initialize_instance_slot at line 477 of Moose/Meta/Attribute.pm, avg 42µs/call
# 2 times (90µs+25.6ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::parameters_metaclass at line 9 of accessor parameters_metaclass (defined at MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm line 32), avg 12.9ms/call | ||||
| 42 | 6923 | 74.4ms | my ( $self, $instance ) = @_; | ||
| 43 | 3728 | 74.8ms | if ( defined $instance && $self->is_default_a_coderef ) { # spent 34.4ms making 2293 calls to Class::MOP::Mixin::AttributeCore::is_default_a_coderef, avg 15µs/call
# spent 25.6ms making 2 calls to MooseX::Role::Parameterized::Meta::Role::Parameterizable::__ANON__[MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm:31], avg 12.8ms/call
# spent 1.63ms making 155 calls to Class::MOP::__ANON__[Class/MOP.pm:234], avg 11µs/call
# spent 1.54ms making 155 calls to Class::MOP::__ANON__[Class/MOP.pm:276], avg 10µs/call
# spent 1.54ms making 155 calls to Class::MOP::__ANON__[Class/MOP.pm:321], avg 10µs/call
# spent 1.51ms making 155 calls to Class::MOP::__ANON__[Class/MOP.pm:192], avg 10µs/call
# spent 1.46ms making 155 calls to Class::MOP::__ANON__[Class/MOP.pm:302], avg 9µs/call
# spent 1.42ms making 132 calls to Moose::Meta::Role::__ANON__[Moose/Meta/Role.pm:302], avg 11µs/call
# spent 1.25ms making 111 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:40], avg 11µs/call
# spent 1.25ms making 111 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:35], avg 11µs/call
# spent 1.13ms making 111 calls to Class::MOP::__ANON__[Class/MOP.pm:337], avg 10µs/call
# spent 979µs making 88 calls to Moose::Meta::Role::__ANON__[Moose/Meta/Role.pm:89], avg 11µs/call
# spent 516µs making 44 calls to Moose::Meta::Role::__ANON__[Moose/Meta/Role.pm:347], avg 12µs/call
# spent 440µs making 44 calls to Moose::Meta::Role::__ANON__[Moose/Meta/Role.pm:392], avg 10µs/call
# spent 174µs making 16 calls to Class::MOP::__ANON__[Class/MOP.pm:510], avg 11µs/call
# spent 10µs making 1 call to Moose::Meta::TypeConstraint::Registry::__ANON__[Moose/Meta/TypeConstraint/Registry.pm:24] | ||
| 44 | # if the default is a CODE ref, then we pass in the instance and | ||||
| 45 | # default can return a value based on that instance. Somewhat crude, | ||||
| 46 | # but works. | ||||
| 47 | return $self->{'default'}->($instance); | ||||
| 48 | } | ||||
| 49 | $self->{'default'}; | ||||
| 50 | } | ||||
| 51 | |||||
| 52 | 1 | 11µs | 1; | ||
| 53 | |||||
| 54 | __END__ |