← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:45:08 2010
Reported on Wed Nov 17 22:10:29 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP/Mixin/AttributeCore.pm
StatementsExecuted 23324 statements in 261ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
27326678.7ms156msClass::MOP::Mixin::AttributeCore::::defaultClass::MOP::Mixin::AttributeCore::default (recurses: max depth 1, inclusive time 1.55ms)
24223336.7ms36.7msClass::MOP::Mixin::AttributeCore::::is_default_a_coderefClass::MOP::Mixin::AttributeCore::is_default_a_coderef
11172µs91µsClass::MOP::Mixin::AttributeCore::::BEGIN@3Class::MOP::Mixin::AttributeCore::BEGIN@3
11143µs64µsClass::MOP::Mixin::AttributeCore::::has_read_methodClass::MOP::Mixin::AttributeCore::has_read_method
11140µs1.73msClass::MOP::Mixin::AttributeCore::::BEGIN@12Class::MOP::Mixin::AttributeCore::BEGIN@12
11140µs197µsClass::MOP::Mixin::AttributeCore::::BEGIN@10Class::MOP::Mixin::AttributeCore::BEGIN@10
11138µs141µsClass::MOP::Mixin::AttributeCore::::BEGIN@4Class::MOP::Mixin::AttributeCore::BEGIN@4
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
3397µs2110µ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
use strict;
# spent 91µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@3 # spent 19µs making 1 call to strict::import
43211µs2245µ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
use warnings;
# spent 141µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@4 # spent 104µs making 1 call to warnings::import
5
614µsour $VERSION = '1.11';
7170µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
813µsour $AUTHORITY = 'cpan:STEVAN';
9
103102µs2354µ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
use Scalar::Util 'blessed';
# spent 197µs making 1 call to Class::MOP::Mixin::AttributeCore::BEGIN@10 # spent 157µs making 1 call to Exporter::import
11
1232.01ms21.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
use base 'Class::MOP::Mixin';
# 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
142563.67mssub has_accessor { defined $_[0]->{'accessor'} }
152563.56mssub has_reader { defined $_[0]->{'reader'} }
162553.67mssub has_writer { defined $_[0]->{'writer'} }
172633.63mssub has_predicate { defined $_[0]->{'predicate'} }
182553.38mssub has_clearer { defined $_[0]->{'clearer'} }
192984.05mssub has_builder { defined $_[0]->{'builder'} }
20sub has_init_arg { defined $_[0]->{'init_arg'} }
215197.18mssub has_default { exists $_[0]->{'default'} }
22428157.6mssub has_initializer { defined $_[0]->{'initializer'} }
23sub has_insertion_order { defined $_[0]->{'insertion_order'} }
24
25781.19mssub accessor { $_[0]->{'accessor'} }
262863.94mssub reader { $_[0]->{'reader'} }
2717248µssub writer { $_[0]->{'writer'} }
2851705µssub predicate { $_[0]->{'predicate'} }
29sub clearer { $_[0]->{'clearer'} }
306118µssub builder { $_[0]->{'builder'} }
31278737.2mssub init_arg { $_[0]->{'init_arg'} }
32sub initializer { $_[0]->{'initializer'} }
333274.74mssub definition_context { $_[0]->{'definition_context'} }
34sub insertion_order { $_[0]->{'insertion_order'} }
352112.80mssub _set_insertion_order { $_[0]->{'insertion_order'} = $_[1] }
36
37148µs221µ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
sub has_read_method { $_[0]->has_reader || $_[0]->has_accessor }
# 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
38sub 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
sub is_default_a_coderef {
41 # Uber hack because it is called from CMOP::Attribute constructor as
42 # $class->is_default_a_coderef(\%options)
43640148.2ms my ($value) = ref $_[0] ? $_[0]->{'default'} : $_[1]->{'default'};
44
45 return unless ref($value);
46
47 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
sub default {
52676072.4ms my ( $self, $instance ) = @_;
53368078.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 $self->{'default'};
60}
61
62112µs1;
63
64__END__