| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP/Mixin/AttributeCore.pm |
| Statements | Executed 23324 statements in 261ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 2732 | 6 | 6 | 78.7ms | 156ms | Class::MOP::Mixin::AttributeCore::default (recurses: max depth 1, inclusive time 1.55ms) |
| 2422 | 3 | 3 | 36.7ms | 36.7ms | Class::MOP::Mixin::AttributeCore::is_default_a_coderef |
| 1 | 1 | 1 | 72µs | 91µs | Class::MOP::Mixin::AttributeCore::BEGIN@3 |
| 1 | 1 | 1 | 43µs | 64µs | Class::MOP::Mixin::AttributeCore::has_read_method |
| 1 | 1 | 1 | 40µs | 1.73ms | Class::MOP::Mixin::AttributeCore::BEGIN@12 |
| 1 | 1 | 1 | 40µs | 197µs | Class::MOP::Mixin::AttributeCore::BEGIN@10 |
| 1 | 1 | 1 | 38µs | 141µs | Class::MOP::Mixin::AttributeCore::BEGIN@4 |
| 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 | 97µs | 2 | 110µs | # spent 91µs (72+19) within Class::MOP::Mixin::AttributeCore::BEGIN@3 which was called:
# once (72µs+19µs) by Class::MOP::BEGIN@16 at line 3 # spent 91µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@3
# spent 19µs making 1 call to strict::import |
| 4 | 3 | 211µs | 2 | 245µs | # spent 141µs (38+104) within Class::MOP::Mixin::AttributeCore::BEGIN@4 which was called:
# once (38µs+104µs) by Class::MOP::BEGIN@16 at line 4 # spent 141µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@4
# spent 104µs making 1 call to warnings::import |
| 5 | |||||
| 6 | 1 | 4µs | our $VERSION = '1.11'; | ||
| 7 | 1 | 70µs | $VERSION = eval $VERSION; # spent 11µs executing statements in string eval | ||
| 8 | 1 | 3µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 9 | |||||
| 10 | 3 | 102µs | 2 | 354µs | # spent 197µs (40+157) within Class::MOP::Mixin::AttributeCore::BEGIN@10 which was called:
# once (40µs+157µs) by Class::MOP::BEGIN@16 at line 10 # spent 197µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@10
# spent 157µs making 1 call to Exporter::import |
| 11 | |||||
| 12 | 3 | 2.01ms | 2 | 1.73ms | # spent 1.73ms (40µs+1.69) within Class::MOP::Mixin::AttributeCore::BEGIN@12 which was called:
# once (40µs+1.69ms) by Class::MOP::BEGIN@16 at line 12 # spent 1.73ms making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@12
# spent 1.69ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 1.69ms |
| 13 | |||||
| 14 | 256 | 3.67ms | sub has_accessor { defined $_[0]->{'accessor'} } | ||
| 15 | 256 | 3.56ms | sub has_reader { defined $_[0]->{'reader'} } | ||
| 16 | 255 | 3.67ms | sub has_writer { defined $_[0]->{'writer'} } | ||
| 17 | 263 | 3.63ms | sub has_predicate { defined $_[0]->{'predicate'} } | ||
| 18 | 255 | 3.38ms | sub has_clearer { defined $_[0]->{'clearer'} } | ||
| 19 | 298 | 4.05ms | sub has_builder { defined $_[0]->{'builder'} } | ||
| 20 | sub has_init_arg { defined $_[0]->{'init_arg'} } | ||||
| 21 | 519 | 7.18ms | sub has_default { exists $_[0]->{'default'} } | ||
| 22 | 4281 | 57.6ms | sub has_initializer { defined $_[0]->{'initializer'} } | ||
| 23 | sub has_insertion_order { defined $_[0]->{'insertion_order'} } | ||||
| 24 | |||||
| 25 | 78 | 1.19ms | sub accessor { $_[0]->{'accessor'} } | ||
| 26 | 286 | 3.94ms | sub reader { $_[0]->{'reader'} } | ||
| 27 | 17 | 248µs | sub writer { $_[0]->{'writer'} } | ||
| 28 | 51 | 705µs | sub predicate { $_[0]->{'predicate'} } | ||
| 29 | sub clearer { $_[0]->{'clearer'} } | ||||
| 30 | 6 | 118µs | sub builder { $_[0]->{'builder'} } | ||
| 31 | 2787 | 37.2ms | sub init_arg { $_[0]->{'init_arg'} } | ||
| 32 | sub initializer { $_[0]->{'initializer'} } | ||||
| 33 | 327 | 4.74ms | sub definition_context { $_[0]->{'definition_context'} } | ||
| 34 | sub insertion_order { $_[0]->{'insertion_order'} } | ||||
| 35 | 211 | 2.80ms | sub _set_insertion_order { $_[0]->{'insertion_order'} = $_[1] } | ||
| 36 | |||||
| 37 | 1 | 48µs | 2 | 21µs | # spent 64µs (43+21) within Class::MOP::Mixin::AttributeCore::has_read_method which was called:
# once (43µs+21µs) by Moose::Meta::Method::Delegation::_get_delegate_accessor at line 125 of Moose/Meta/Method/Delegation.pm # spent 11µs making 1 call to Class::MOP::Mixin::AttributeCore::has_accessor
# spent 10µs making 1 call to Class::MOP::Mixin::AttributeCore::has_reader |
| 38 | sub has_write_method { $_[0]->has_writer || $_[0]->has_accessor } | ||||
| 39 | |||||
| 40 | # spent 36.7ms within Class::MOP::Mixin::AttributeCore::is_default_a_coderef which was called 2422 times, avg 15µs/call:
# 2244 times (33.3ms+0s) by Class::MOP::Mixin::AttributeCore::default at line 53, avg 15µs/call
# 145 times (2.73ms+0s) by Class::MOP::Method::Constructor::_generate_default_value at line 186 of Class/MOP/Method/Constructor.pm, avg 19µs/call
# 33 times (665µs+0s) by Class::MOP::Attribute::new at line 47 of Class/MOP/Attribute.pm, avg 20µs/call | ||||
| 41 | # Uber hack because it is called from CMOP::Attribute constructor as | ||||
| 42 | # $class->is_default_a_coderef(\%options) | ||||
| 43 | 2422 | 12.7ms | my ($value) = ref $_[0] ? $_[0]->{'default'} : $_[1]->{'default'}; | ||
| 44 | |||||
| 45 | 2422 | 13.6ms | return unless ref($value); | ||
| 46 | |||||
| 47 | 1557 | 21.9ms | return ref($value) eq 'CODE' | ||
| 48 | || ( blessed($value) && $value->isa('Class::MOP::Method') ); | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | # spent 156ms (78.7+76.9) within Class::MOP::Mixin::AttributeCore::default which was called 2732 times, avg 57µs/call:
# 2234 times (71.3ms+46.2ms) by Class::MOP::Attribute::initialize_instance_slot at line 115 of Class/MOP/Attribute.pm, avg 53µs/call
# 265 times (3.64ms+0s) by Class::MOP::Method::Constructor::_generate_constructor_method_inline at line 98 of Class/MOP/Method/Constructor.pm, avg 14µs/call
# 130 times (1.87ms+0s) by Moose::Meta::Method::Constructor::_initialize_body at line 99 of Moose/Meta/Method/Constructor.pm, avg 14µs/call
# 93 times (1.62ms+0s) by Class::MOP::Class::_immutable_metaclass at line 1227 of Class/MOP/Class.pm, avg 17µs/call
# 8 times (219µs+106µs) by Moose::Meta::Attribute::initialize_instance_slot at line 472 of Moose/Meta/Attribute.pm, avg 41µs/call
# 2 times (93µs+30.5ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::parameters_metaclass at line 44 of accessor parameters_metaclass defined at MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm, avg 15.3ms/call | ||||
| 52 | 2732 | 7.45ms | my ( $self, $instance ) = @_; | ||
| 53 | 2732 | 48.5ms | 3680 | 78.4ms | if ( defined $instance && $self->is_default_a_coderef ) { # spent 33.3ms making 2244 calls to Class::MOP::Mixin::AttributeCore::is_default_a_coderef, avg 15µs/call
# spent 30.5ms making 2 calls to MooseX::Role::Parameterized::Meta::Role::Parameterizable::__ANON__[MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm:31], avg 15.3ms/call
# spent 1.60ms making 154 calls to Class::MOP::__ANON__[Class/MOP.pm:321], avg 10µs/call
# spent 1.54ms making 154 calls to Class::MOP::__ANON__[Class/MOP.pm:192], avg 10µs/call
# spent 1.54ms making 154 calls to Class::MOP::__ANON__[Class/MOP.pm:234], avg 10µs/call
# spent 1.44ms making 154 calls to Class::MOP::__ANON__[Class/MOP.pm:302], avg 9µs/call
# spent 1.44ms making 154 calls to Class::MOP::__ANON__[Class/MOP.pm:276], avg 9µs/call
# spent 1.27ms making 132 calls to Moose::Meta::Role::__ANON__[Moose/Meta/Role.pm:295], avg 10µs/call
# spent 1.26ms making 110 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:40], avg 11µs/call
# spent 1.23ms making 110 calls to Moose::Meta::Class::__ANON__[Moose/Meta/Class.pm:35], avg 11µs/call
# spent 1.17ms making 110 calls to Class::MOP::__ANON__[Class/MOP.pm:337], avg 11µs/call
# spent 975µs making 88 calls to Moose::Meta::Role::__ANON__[Moose/Meta/Role.pm:89], avg 11µs/call
# spent 462µs making 44 calls to Moose::Meta::Role::__ANON__[Moose/Meta/Role.pm:340], avg 10µs/call
# spent 448µs making 44 calls to Moose::Meta::Role::__ANON__[Moose/Meta/Role.pm:392], avg 10µs/call
# spent 276µs making 25 calls to Class::MOP::__ANON__[Class/MOP.pm:510], avg 11µs/call
# spent 11µs making 1 call to Moose::Meta::TypeConstraint::Registry::__ANON__[Moose/Meta/TypeConstraint/Registry.pm:24] |
| 54 | # if the default is a CODE ref, then we pass in the instance and | ||||
| 55 | # default can return a value based on that instance. Somewhat crude, | ||||
| 56 | # but works. | ||||
| 57 | return $self->{'default'}->($instance); | ||||
| 58 | } | ||||
| 59 | 1296 | 16.5ms | $self->{'default'}; | ||
| 60 | } | ||||
| 61 | |||||
| 62 | 1 | 12µs | 1; | ||
| 63 | |||||
| 64 | __END__ |