| Filename | /home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm |
| Statements | Executed 8318 statements in 148ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 366 | 2 | 2 | 46.5ms | 870ms | Class::MOP::Method::Accessor::new |
| 361 | 1 | 1 | 22.1ms | 753ms | Class::MOP::Method::Accessor::_initialize_body |
| 225 | 2 | 2 | 15.5ms | 15.5ms | Class::MOP::Method::Accessor::_new |
| 150 | 2 | 2 | 10.2ms | 394ms | Class::MOP::Method::Accessor::_generate_reader_method_inline |
| 150 | 1 | 1 | 9.37ms | 364ms | Class::MOP::Method::Accessor::__ANON__[:152] |
| 43 | 2 | 2 | 2.84ms | 77.6ms | Class::MOP::Method::Accessor::_generate_predicate_method_inline |
| 41 | 2 | 2 | 2.75ms | 133ms | Class::MOP::Method::Accessor::_generate_accessor_method_inline |
| 41 | 1 | 1 | 2.65ms | 125ms | Class::MOP::Method::Accessor::__ANON__[:118] |
| 53 | 1 | 1 | 1.94ms | 2.42ms | Class::MOP::Method::Accessor::_generate_reader_method |
| 29 | 1 | 1 | 1.93ms | 59.0ms | Class::MOP::Method::Accessor::_generate_clearer_method_inline |
| 43 | 1 | 1 | 1.80ms | 69.2ms | Class::MOP::Method::Accessor::__ANON__[:207] |
| 29 | 1 | 1 | 1.21ms | 53.4ms | Class::MOP::Method::Accessor::__ANON__[:232] |
| 14 | 2 | 2 | 966µs | 33.3ms | Class::MOP::Method::Accessor::_generate_writer_method_inline |
| 53 | 1 | 1 | 732µs | 732µs | Class::MOP::Method::Accessor::_inline_throw_error |
| 15 | 1 | 1 | 674µs | 823µs | Class::MOP::Method::Accessor::_generate_accessor_method |
| 14 | 1 | 1 | 597µs | 30.6ms | Class::MOP::Method::Accessor::__ANON__[:182] |
| 13 | 1 | 1 | 486µs | 608µs | Class::MOP::Method::Accessor::_generate_predicate_method |
| 3 | 1 | 1 | 124µs | 152µs | Class::MOP::Method::Accessor::_generate_writer_method |
| 1 | 1 | 1 | 80µs | 99µs | Class::MOP::Method::Accessor::BEGIN@4 |
| 1 | 1 | 1 | 48µs | 123µs | Class::MOP::Method::Accessor::BEGIN@5 |
| 1 | 1 | 1 | 42µs | 30.9ms | Class::MOP::Method::Accessor::BEGIN@15 |
| 1 | 1 | 1 | 38µs | 216µs | Class::MOP::Method::Accessor::BEGIN@9 |
| 1 | 1 | 1 | 38µs | 225µs | Class::MOP::Method::Accessor::BEGIN@8 |
| 1 | 1 | 1 | 37µs | 195µs | Class::MOP::Method::Accessor::BEGIN@7 |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:102] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:121] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:132] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:155] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:169] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:185] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:194] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:210] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:219] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::__ANON__[:235] |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Accessor::_generate_clearer_method |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Class::MOP::Method::Accessor; | ||||
| 3 | |||||
| 4 | 3 | 117µs | 2 | 118µs | # spent 99µs (80+19) within Class::MOP::Method::Accessor::BEGIN@4 which was called:
# once (80µs+19µs) by Class::MOP::Class::BEGIN@9 at line 4 # spent 99µs making 1 call to Class::MOP::Method::Accessor::BEGIN@4
# spent 19µs making 1 call to strict::import |
| 5 | 3 | 115µs | 2 | 198µs | # spent 123µs (48+75) within Class::MOP::Method::Accessor::BEGIN@5 which was called:
# once (48µs+75µs) by Class::MOP::Class::BEGIN@9 at line 5 # spent 123µs making 1 call to Class::MOP::Method::Accessor::BEGIN@5
# spent 75µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 3 | 106µs | 2 | 353µs | # spent 195µs (37+158) within Class::MOP::Method::Accessor::BEGIN@7 which was called:
# once (37µs+158µs) by Class::MOP::Class::BEGIN@9 at line 7 # spent 195µs making 1 call to Class::MOP::Method::Accessor::BEGIN@7
# spent 158µs making 1 call to Exporter::import |
| 8 | 3 | 100µs | 2 | 413µs | # spent 225µs (38+188) within Class::MOP::Method::Accessor::BEGIN@8 which was called:
# once (38µs+188µs) by Class::MOP::Class::BEGIN@9 at line 8 # spent 225µs making 1 call to Class::MOP::Method::Accessor::BEGIN@8
# spent 188µs making 1 call to Exporter::import |
| 9 | 3 | 248µs | 2 | 393µs | # spent 216µs (38+177) within Class::MOP::Method::Accessor::BEGIN@9 which was called:
# once (38µs+177µs) by Class::MOP::Class::BEGIN@9 at line 9 # spent 216µs making 1 call to Class::MOP::Method::Accessor::BEGIN@9
# spent 177µs making 1 call to Exporter::import |
| 10 | |||||
| 11 | 1 | 5µs | our $VERSION = '1.11'; | ||
| 12 | 1 | 73µs | $VERSION = eval $VERSION; # spent 13µs executing statements in string eval | ||
| 13 | 1 | 4µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 14 | |||||
| 15 | 3 | 3.85ms | 2 | 61.8ms | # spent 30.9ms (42µs+30.9) within Class::MOP::Method::Accessor::BEGIN@15 which was called:
# once (42µs+30.9ms) by Class::MOP::Class::BEGIN@9 at line 15 # spent 30.9ms making 1 call to Class::MOP::Method::Accessor::BEGIN@15
# spent 30.9ms making 1 call to base::import |
| 16 | |||||
| 17 | # spent 870ms (46.5+824) within Class::MOP::Method::Accessor::new which was called 366 times, avg 2.38ms/call:
# 361 times (45.9ms+799ms) by Class::MOP::Attribute::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Attribute.pm:401] at line 393 of Class/MOP/Attribute.pm, avg 2.34ms/call
# 5 times (615µs+24.6ms) by Class::MOP::Class:::around at line 31 of Moose/Meta/Method/Accessor/Native.pm, avg 5.04ms/call | ||||
| 18 | 3660 | 54.1ms | my $class = shift; | ||
| 19 | my %options = @_; | ||||
| 20 | |||||
| 21 | (exists $options{attribute}) | ||||
| 22 | || confess "You must supply an attribute to construct with"; | ||||
| 23 | |||||
| 24 | (exists $options{accessor_type}) | ||||
| 25 | || confess "You must supply an accessor_type to construct with"; | ||||
| 26 | |||||
| 27 | 732 | 5.42ms | (blessed($options{attribute}) && $options{attribute}->isa('Class::MOP::Attribute')) # spent 2.90ms making 366 calls to Scalar::Util::blessed, avg 8µs/call
# spent 2.52ms making 366 calls to UNIVERSAL::isa, avg 7µs/call | ||
| 28 | || confess "You must supply an attribute which is a 'Class::MOP::Attribute' instance"; | ||||
| 29 | |||||
| 30 | ($options{package_name} && $options{name}) | ||||
| 31 | || confess "You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT"; | ||||
| 32 | |||||
| 33 | 366 | 42.2ms | my $self = $class->_new(\%options); # spent 20.0ms making 191 calls to Moose::Meta::Method::Accessor::_new, avg 105µs/call
# spent 8.82ms making 168 calls to Class::MOP::Method::Accessor::_new, avg 53µs/call
# spent 8.64ms making 2 calls to Class::MOP::Method::_new, avg 4.32ms/call
# spent 4.69ms making 5 calls to Moose::Meta::Method::Accessor::Native::_new, avg 937µs/call | ||
| 34 | |||||
| 35 | # we don't want this creating | ||||
| 36 | # a cycle in the code, if not | ||||
| 37 | # needed | ||||
| 38 | 366 | 3.26ms | weaken($self->{'attribute'}); # spent 3.26ms making 366 calls to Scalar::Util::weaken, avg 9µs/call | ||
| 39 | |||||
| 40 | 366 | 773ms | $self->_initialize_body; # spent 753ms making 361 calls to Class::MOP::Method::Accessor::_initialize_body, avg 2.09ms/call
# spent 19.8ms making 5 calls to Moose::Meta::Method::Accessor::Native::_initialize_body, avg 3.95ms/call | ||
| 41 | |||||
| 42 | return $self; | ||||
| 43 | } | ||||
| 44 | |||||
| 45 | # spent 15.5ms within Class::MOP::Method::Accessor::_new which was called 225 times, avg 69µs/call:
# 168 times (8.82ms+0s) by Class::MOP::Method::Accessor::new at line 33, avg 53µs/call
# 57 times (6.64ms+0s) by Class::MOP::Method::wrap at line 44 of Class/MOP/Method.pm, avg 116µs/call | ||||
| 46 | 900 | 16.4ms | my $class = shift; | ||
| 47 | |||||
| 48 | return Class::MOP::Class->initialize($class)->new_object(@_) | ||||
| 49 | if $class ne __PACKAGE__; | ||||
| 50 | |||||
| 51 | my $params = @_ == 1 ? $_[0] : {@_}; | ||||
| 52 | |||||
| 53 | return bless { | ||||
| 54 | # inherited from Class::MOP::Method | ||||
| 55 | body => $params->{body}, | ||||
| 56 | associated_metaclass => $params->{associated_metaclass}, | ||||
| 57 | package_name => $params->{package_name}, | ||||
| 58 | name => $params->{name}, | ||||
| 59 | original_method => $params->{original_method}, | ||||
| 60 | |||||
| 61 | # inherit from Class::MOP::Generated | ||||
| 62 | is_inline => $params->{is_inline} || 0, | ||||
| 63 | definition_context => $params->{definition_context}, | ||||
| 64 | |||||
| 65 | # defined in this class | ||||
| 66 | attribute => $params->{attribute}, | ||||
| 67 | accessor_type => $params->{accessor_type}, | ||||
| 68 | } => $class; | ||||
| 69 | } | ||||
| 70 | |||||
| 71 | ## accessors | ||||
| 72 | |||||
| 73 | 790 | 11.4ms | sub associated_attribute { (shift)->{'attribute'} } | ||
| 74 | 361 | 5.18ms | sub accessor_type { (shift)->{'accessor_type'} } | ||
| 75 | |||||
| 76 | ## factory | ||||
| 77 | |||||
| 78 | # spent 753ms (22.1+731) within Class::MOP::Method::Accessor::_initialize_body which was called 361 times, avg 2.09ms/call:
# 361 times (22.1ms+731ms) by Class::MOP::Method::Accessor::new at line 40, avg 2.09ms/call | ||||
| 79 | 1083 | 23.0ms | my $self = shift; | ||
| 80 | |||||
| 81 | 722 | 6.15ms | my $method_name = join "_" => ( # spent 3.72ms making 361 calls to Class::MOP::Method::Accessor::accessor_type, avg 10µs/call
# spent 2.43ms making 361 calls to Class::MOP::Method::Generated::is_inline, avg 7µs/call | ||
| 82 | '_generate', | ||||
| 83 | $self->accessor_type, | ||||
| 84 | 'method', | ||||
| 85 | ($self->is_inline ? 'inline' : ()) | ||||
| 86 | ); | ||||
| 87 | |||||
| 88 | 361 | 725ms | $self->{'body'} = $self->$method_name(); # spent 326ms making 96 calls to Moose::Meta::Method::Accessor::_generate_reader_method, avg 3.40ms/call
# spent 108ms making 26 calls to Moose::Meta::Method::Accessor::_generate_accessor_method, avg 4.16ms/call
# spent 79.6ms making 54 calls to Class::MOP::Method::Accessor::_generate_reader_method_inline, avg 1.47ms/call
# spent 65.7ms making 30 calls to Moose::Meta::Method::Accessor::_generate_predicate_method, avg 2.19ms/call
# spent 62.7ms making 29 calls to Moose::Meta::Method::Accessor::_generate_clearer_method, avg 2.16ms/call
# spent 31.0ms making 11 calls to Moose::Meta::Method::Accessor::_generate_writer_method, avg 2.82ms/call
# spent 28.2ms making 15 calls to Class::MOP::Method::Accessor::_generate_accessor_method_inline, avg 1.88ms/call
# spent 15.7ms making 13 calls to Class::MOP::Method::Accessor::_generate_predicate_method_inline, avg 1.21ms/call
# spent 3.70ms making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method_inline, avg 1.23ms/call
# spent 2.42ms making 53 calls to Class::MOP::Method::Accessor::_generate_reader_method, avg 46µs/call
# spent 823µs making 15 calls to Class::MOP::Method::Accessor::_generate_accessor_method, avg 55µs/call
# spent 608µs making 13 calls to Class::MOP::Method::Accessor::_generate_predicate_method, avg 47µs/call
# spent 152µs making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method, avg 51µs/call | ||
| 89 | } | ||||
| 90 | |||||
| 91 | ## generators | ||||
| 92 | |||||
| 93 | # spent 823µs (674+149) within Class::MOP::Method::Accessor::_generate_accessor_method which was called 15 times, avg 55µs/call:
# 15 times (674µs+149µs) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 55µs/call | ||||
| 94 | 45 | 644µs | my $self = shift; | ||
| 95 | 15 | 149µs | my $attr = $self->associated_attribute; # spent 149µs making 15 calls to Class::MOP::Method::Accessor::associated_attribute, avg 10µs/call | ||
| 96 | |||||
| 97 | return sub { | ||||
| 98 | if (@_ >= 2) { | ||||
| 99 | $attr->set_value($_[0], $_[1]); | ||||
| 100 | } | ||||
| 101 | $attr->get_value($_[0]); | ||||
| 102 | }; | ||||
| 103 | } | ||||
| 104 | |||||
| 105 | # spent 133ms (2.75+130) within Class::MOP::Method::Accessor::_generate_accessor_method_inline which was called 41 times, avg 3.24ms/call:
# 26 times (1.77ms+103ms) by Moose::Meta::Method::Accessor::_generate_accessor_method at line 76 of Moose/Meta/Method/Accessor.pm, avg 4.03ms/call
# 15 times (980µs+27.2ms) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 1.88ms/call | ||||
| 106 | 123 | 2.34ms | my $self = shift; | ||
| 107 | 41 | 336µs | my $attr = $self->associated_attribute; # spent 336µs making 41 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call | ||
| 108 | |||||
| 109 | # spent 125ms (2.65+122) within Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:118] which was called 41 times, avg 3.05ms/call:
# 41 times (2.65ms+122ms) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 3.05ms/call | ||||
| 110 | 41 | 2.26ms | 123 | 122ms | $self->_compile_code([ # spent 47.4ms making 26 calls to Moose::Meta::Method::Accessor::_compile_code, avg 1.82ms/call
# spent 41.5ms making 26 calls to Moose::Meta::Attribute::_inline_set_value, avg 1.60ms/call
# spent 14.0ms making 15 calls to Class::MOP::Method::Generated::_compile_code, avg 932µs/call
# spent 8.70ms making 26 calls to Moose::Meta::Attribute::_inline_get_value, avg 335µs/call
# spent 8.42ms making 15 calls to Class::MOP::Attribute::_inline_set_value, avg 561µs/call
# spent 2.21ms making 15 calls to Class::MOP::Attribute::_inline_get_value, avg 148µs/call |
| 111 | 'sub {', | ||||
| 112 | 'if (@_ > 1) {', | ||||
| 113 | $attr->_inline_set_value('$_[0]', '$_[1]'), | ||||
| 114 | '}', | ||||
| 115 | $attr->_inline_get_value('$_[0]'), | ||||
| 116 | '}', | ||||
| 117 | ]); | ||||
| 118 | } | ||||
| 119 | catch { | ||||
| 120 | confess "Could not generate inline accessor because : $_"; | ||||
| 121 | 82 | 694µs | }; # spent 694µs making 41 calls to Try::Tiny::catch, avg 17µs/call
# spent 129ms making 41 calls to Try::Tiny::try, avg 3.15ms/call, recursion: max depth 2, sum of overlapping time 129ms | ||
| 122 | } | ||||
| 123 | |||||
| 124 | # spent 2.42ms (1.94+478µs) within Class::MOP::Method::Accessor::_generate_reader_method which was called 53 times, avg 46µs/call:
# 53 times (1.94ms+478µs) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 46µs/call | ||||
| 125 | 159 | 1.87ms | my $self = shift; | ||
| 126 | 53 | 478µs | my $attr = $self->associated_attribute; # spent 478µs making 53 calls to Class::MOP::Method::Accessor::associated_attribute, avg 9µs/call | ||
| 127 | |||||
| 128 | return sub { | ||||
| 129 | 28 | 344µs | confess "Cannot assign a value to a read-only accessor" | ||
| 130 | if @_ > 1; | ||||
| 131 | 14 | 2.52ms | $attr->get_value($_[0]); # spent 2.52ms making 14 calls to Class::MOP::Attribute::get_value, avg 180µs/call | ||
| 132 | }; | ||||
| 133 | } | ||||
| 134 | |||||
| 135 | # spent 394ms (10.2+384) within Class::MOP::Method::Accessor::_generate_reader_method_inline which was called 150 times, avg 2.63ms/call:
# 96 times (6.58ms+308ms) by Moose::Meta::Method::Accessor::_generate_reader_method at line 64 of Moose/Meta/Method/Accessor.pm, avg 3.27ms/call
# 54 times (3.61ms+76.0ms) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 1.47ms/call | ||||
| 136 | 450 | 8.55ms | my $self = shift; | ||
| 137 | 150 | 1.23ms | my $attr = $self->associated_attribute; # spent 1.23ms making 150 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call | ||
| 138 | |||||
| 139 | # spent 364ms (9.37+355) within Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:152] which was called 150 times, avg 2.43ms/call:
# 150 times (9.37ms+355ms) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 2.43ms/call | ||||
| 140 | 150 | 7.88ms | 450 | 355ms | $self->_compile_code([ # spent 165ms making 97 calls to Moose::Meta::Method::Accessor::_compile_code, avg 1.71ms/call
# spent 122ms making 97 calls to Moose::Meta::Attribute::_inline_get_value, avg 1.26ms/call
# spent 44.2ms making 53 calls to Class::MOP::Method::Generated::_compile_code, avg 835µs/call
# spent 19.5ms making 53 calls to Class::MOP::Attribute::_inline_get_value, avg 368µs/call
# spent 3.00ms making 97 calls to Moose::Meta::Method::_inline_throw_error, avg 31µs/call
# spent 732µs making 53 calls to Class::MOP::Method::Accessor::_inline_throw_error, avg 14µs/call |
| 141 | 'sub {', | ||||
| 142 | 'if (@_ > 1) {', | ||||
| 143 | # XXX: this is a hack, but our error stuff is terrible | ||||
| 144 | $self->_inline_throw_error( | ||||
| 145 | '"Cannot assign a value to a read-only accessor"', | ||||
| 146 | 'data => \@_' | ||||
| 147 | ) . ';', | ||||
| 148 | '}', | ||||
| 149 | $attr->_inline_get_value('$_[0]'), | ||||
| 150 | '}', | ||||
| 151 | ]); | ||||
| 152 | } | ||||
| 153 | catch { | ||||
| 154 | confess "Could not generate inline reader because : $_"; | ||||
| 155 | 300 | 2.62ms | }; # spent 2.62ms making 150 calls to Try::Tiny::catch, avg 17µs/call
# spent 380ms making 150 calls to Try::Tiny::try, avg 2.53ms/call, recursion: max depth 3, sum of overlapping time 380ms | ||
| 156 | } | ||||
| 157 | |||||
| 158 | # spent 732µs within Class::MOP::Method::Accessor::_inline_throw_error which was called 53 times, avg 14µs/call:
# 53 times (732µs+0s) by Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:152] at line 140, avg 14µs/call | ||||
| 159 | 106 | 1.03ms | my $self = shift; | ||
| 160 | return 'confess ' . $_[0]; | ||||
| 161 | } | ||||
| 162 | |||||
| 163 | # spent 152µs (124+29) within Class::MOP::Method::Accessor::_generate_writer_method which was called 3 times, avg 51µs/call:
# 3 times (124µs+29µs) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 51µs/call | ||||
| 164 | 9 | 117µs | my $self = shift; | ||
| 165 | 3 | 29µs | my $attr = $self->associated_attribute; # spent 29µs making 3 calls to Class::MOP::Method::Accessor::associated_attribute, avg 10µs/call | ||
| 166 | |||||
| 167 | return sub { | ||||
| 168 | $attr->set_value($_[0], $_[1]); | ||||
| 169 | }; | ||||
| 170 | } | ||||
| 171 | |||||
| 172 | # spent 33.3ms (966µs+32.3) within Class::MOP::Method::Accessor::_generate_writer_method_inline which was called 14 times, avg 2.38ms/call:
# 11 times (760µs+28.8ms) by Moose::Meta::Method::Accessor::_generate_writer_method at line 70 of Moose/Meta/Method/Accessor.pm, avg 2.69ms/call
# 3 times (206µs+3.50ms) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 1.23ms/call | ||||
| 173 | 42 | 799µs | my $self = shift; | ||
| 174 | 14 | 108µs | my $attr = $self->associated_attribute; # spent 108µs making 14 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call | ||
| 175 | |||||
| 176 | # spent 30.6ms (597µs+30.0) within Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:182] which was called 14 times, avg 2.18ms/call:
# 14 times (597µs+30.0ms) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 2.18ms/call | ||||
| 177 | 14 | 520µs | 28 | 30.0ms | $self->_compile_code([ # spent 18.0ms making 11 calls to Moose::Meta::Method::Accessor::_compile_code, avg 1.64ms/call
# spent 8.92ms making 11 calls to Moose::Meta::Attribute::_inline_set_value, avg 811µs/call
# spent 2.58ms making 3 calls to Class::MOP::Method::Generated::_compile_code, avg 859µs/call
# spent 464µs making 3 calls to Class::MOP::Attribute::_inline_set_value, avg 154µs/call |
| 178 | 'sub {', | ||||
| 179 | $attr->_inline_set_value('$_[0]', '$_[1]'), | ||||
| 180 | '}', | ||||
| 181 | ]); | ||||
| 182 | } | ||||
| 183 | catch { | ||||
| 184 | confess "Could not generate inline writer because : $_"; | ||||
| 185 | 28 | 241µs | }; # spent 241µs making 14 calls to Try::Tiny::catch, avg 17µs/call
# spent 32.0ms making 14 calls to Try::Tiny::try, avg 2.28ms/call, recursion: max depth 2, sum of overlapping time 32.0ms | ||
| 186 | } | ||||
| 187 | |||||
| 188 | # spent 608µs (486+122) within Class::MOP::Method::Accessor::_generate_predicate_method which was called 13 times, avg 47µs/call:
# 13 times (486µs+122µs) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 47µs/call | ||||
| 189 | 39 | 460µs | my $self = shift; | ||
| 190 | 13 | 122µs | my $attr = $self->associated_attribute; # spent 122µs making 13 calls to Class::MOP::Method::Accessor::associated_attribute, avg 9µs/call | ||
| 191 | |||||
| 192 | return sub { | ||||
| 193 | 8 | 174µs | 8 | 1.36ms | $attr->has_value($_[0]) # spent 1.36ms making 8 calls to Class::MOP::Attribute::has_value, avg 170µs/call |
| 194 | }; | ||||
| 195 | } | ||||
| 196 | |||||
| 197 | # spent 77.6ms (2.84+74.7) within Class::MOP::Method::Accessor::_generate_predicate_method_inline which was called 43 times, avg 1.80ms/call:
# 30 times (2.02ms+59.9ms) by Moose::Meta::Method::Accessor::_generate_predicate_method at line 82 of Moose/Meta/Method/Accessor.pm, avg 2.06ms/call
# 13 times (824µs+14.8ms) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 1.21ms/call | ||||
| 198 | 129 | 2.43ms | my $self = shift; | ||
| 199 | 43 | 353µs | my $attr = $self->associated_attribute; # spent 353µs making 43 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call | ||
| 200 | |||||
| 201 | # spent 69.2ms (1.80+67.4) within Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:207] which was called 43 times, avg 1.61ms/call:
# 43 times (1.80ms+67.4ms) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 1.61ms/call | ||||
| 202 | 43 | 1.58ms | 86 | 67.4ms | $self->_compile_code([ # spent 49.6ms making 30 calls to Moose::Meta::Method::Accessor::_compile_code, avg 1.65ms/call
# spent 10.7ms making 13 calls to Class::MOP::Method::Generated::_compile_code, avg 825µs/call
# spent 7.10ms making 43 calls to Class::MOP::Attribute::_inline_has_value, avg 165µs/call |
| 203 | 'sub {', | ||||
| 204 | $attr->_inline_has_value('$_[0]'), | ||||
| 205 | '}', | ||||
| 206 | ]); | ||||
| 207 | } | ||||
| 208 | catch { | ||||
| 209 | confess "Could not generate inline predicate because : $_"; | ||||
| 210 | 86 | 810µs | }; # spent 810µs making 43 calls to Try::Tiny::catch, avg 19µs/call
# spent 73.6ms making 43 calls to Try::Tiny::try, avg 1.71ms/call, recursion: max depth 2, sum of overlapping time 73.6ms | ||
| 211 | } | ||||
| 212 | |||||
| 213 | sub _generate_clearer_method { | ||||
| 214 | my $self = shift; | ||||
| 215 | my $attr = $self->associated_attribute; | ||||
| 216 | |||||
| 217 | return sub { | ||||
| 218 | $attr->clear_value($_[0]) | ||||
| 219 | }; | ||||
| 220 | } | ||||
| 221 | |||||
| 222 | # spent 59.0ms (1.93+57.1) within Class::MOP::Method::Accessor::_generate_clearer_method_inline which was called 29 times, avg 2.03ms/call:
# 29 times (1.93ms+57.1ms) by Moose::Meta::Method::Accessor::_generate_clearer_method at line 88 of Moose/Meta/Method/Accessor.pm, avg 2.03ms/call | ||||
| 223 | 87 | 1.62ms | my $self = shift; | ||
| 224 | 29 | 233µs | my $attr = $self->associated_attribute; # spent 233µs making 29 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call | ||
| 225 | |||||
| 226 | # spent 53.4ms (1.21+52.2) within Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:232] which was called 29 times, avg 1.84ms/call:
# 29 times (1.21ms+52.2ms) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 1.84ms/call | ||||
| 227 | 29 | 1.09ms | 58 | 52.2ms | $self->_compile_code([ # spent 46.8ms making 29 calls to Moose::Meta::Method::Accessor::_compile_code, avg 1.61ms/call
# spent 5.39ms making 29 calls to Class::MOP::Attribute::_inline_clear_value, avg 186µs/call |
| 228 | 'sub {', | ||||
| 229 | $attr->_inline_clear_value('$_[0]'), | ||||
| 230 | '}', | ||||
| 231 | ]); | ||||
| 232 | } | ||||
| 233 | catch { | ||||
| 234 | confess "Could not generate inline clearer because : $_"; | ||||
| 235 | 58 | 506µs | }; # spent 506µs making 29 calls to Try::Tiny::catch, avg 17µs/call
# spent 56.3ms making 29 calls to Try::Tiny::try, avg 1.94ms/call, recursion: max depth 2, sum of overlapping time 56.3ms | ||
| 236 | } | ||||
| 237 | |||||
| 238 | 1 | 12µs | 1; | ||
| 239 | |||||
| 240 | __END__ |