← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 22:00:36 2010
Reported on Wed Nov 17 22:09:56 2010

Filename/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Mixin/AttributeCore.pm
StatementsExecuted 20176 statements in 217ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
27866680.3ms154msClass::MOP::Mixin::AttributeCore::::defaultClass::MOP::Mixin::AttributeCore::default (recurses: max depth 1, inclusive time 1.39ms)
24773337.7ms37.7msClass::MOP::Mixin::AttributeCore::::is_default_a_coderefClass::MOP::Mixin::AttributeCore::is_default_a_coderef
111107µs175µsClass::MOP::Mixin::AttributeCore::::BEGIN@4Class::MOP::Mixin::AttributeCore::BEGIN@4
11177µs111µsClass::MOP::Mixin::AttributeCore::::has_read_methodClass::MOP::Mixin::AttributeCore::has_read_method
11168µs86µsClass::MOP::Mixin::AttributeCore::::BEGIN@3Class::MOP::Mixin::AttributeCore::BEGIN@3
11145µs1.69msClass::MOP::Mixin::AttributeCore::::BEGIN@12Class::MOP::Mixin::AttributeCore::BEGIN@12
11140µs199µsClass::MOP::Mixin::AttributeCore::::BEGIN@10Class::MOP::Mixin::AttributeCore::BEGIN@10
0000s0sClass::MOP::Mixin::AttributeCore::::has_write_methodClass::MOP::Mixin::AttributeCore::has_write_method
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Class::MOP::Mixin::AttributeCore;
2
3398µs2105µ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
use strict;
# spent 86µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@3 # spent 18µs making 1 call to strict::import
43222µs2243µ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
use warnings;
# spent 175µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@4 # spent 68µs making 1 call to warnings::import
5
614µsour $VERSION = '1.11';
7160µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
813µsour $AUTHORITY = 'cpan:STEVAN';
9
103104µs2358µ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
use Scalar::Util 'blessed';
# spent 199µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@10 # spent 159µs making 1 call to Exporter::import
11
1231.44ms21.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
use base 'Class::MOP::Mixin';
# 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
142583.76mssub has_accessor { defined $_[0]->{'accessor'} }
152583.69mssub has_reader { defined $_[0]->{'reader'} }
162573.87mssub has_writer { defined $_[0]->{'writer'} }
172653.71mssub has_predicate { defined $_[0]->{'predicate'} }
182573.34mssub has_clearer { defined $_[0]->{'clearer'} }
192983.99mssub has_builder { defined $_[0]->{'builder'} }
20sub has_init_arg { defined $_[0]->{'init_arg'} }
214656.32mssub has_default { exists $_[0]->{'default'} }
22445460.4mssub has_initializer { defined $_[0]->{'initializer'} }
23sub has_insertion_order { defined $_[0]->{'insertion_order'} }
24
252122.95mssub _set_insertion_order { $_[0]->{'insertion_order'} = $_[1] }
26
27156µs235µ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
sub has_read_method { $_[0]->has_reader || $_[0]->has_accessor }
# 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
28sub 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
sub is_default_a_coderef {
31 # Uber hack because it is called from CMOP::Attribute constructor as
32 # $class->is_default_a_coderef(\%options)
33651249.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
sub default {
42692374.4ms my ( $self, $instance ) = @_;
43372874.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
52111µs1;
53
54__END__