← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:10 2016

Filename/usr/local/lib/perl/5.18.2/Class/MOP/Method/Accessor.pm
StatementsExecuted 9420 statements in 30.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3832211.9ms256msClass::MOP::Method::Accessor::::newClass::MOP::Method::Accessor::new
165225.58ms119msClass::MOP::Method::Accessor::::_generate_reader_method_inlineClass::MOP::Method::Accessor::_generate_reader_method_inline
333113.02ms151msClass::MOP::Method::Accessor::::_initialize_bodyClass::MOP::Method::Accessor::_initialize_body
403332.21ms36.1msClass::MOP::Method::Accessor::::_newClass::MOP::Method::Accessor::_new
4522529µs17.4msClass::MOP::Method::Accessor::::_generate_predicate_method_inlineClass::MOP::Method::Accessor::_generate_predicate_method_inline
23586519µs519µsClass::MOP::Method::Accessor::::_inline_throw_exceptionClass::MOP::Method::Accessor::_inline_throw_exception
5411343µs398µsClass::MOP::Method::Accessor::::_generate_reader_methodClass::MOP::Method::Accessor::_generate_reader_method
2111207µs5.10msClass::MOP::Method::Accessor::::_generate_accessor_method_inlineClass::MOP::Method::Accessor::_generate_accessor_method_inline
2111112µs126µsClass::MOP::Method::Accessor::::_generate_accessor_methodClass::MOP::Method::Accessor::_generate_accessor_method
82298µs3.30msClass::MOP::Method::Accessor::::_generate_writer_method_inlineClass::MOP::Method::Accessor::_generate_writer_method_inline
151184µs94µsClass::MOP::Method::Accessor::::_generate_predicate_methodClass::MOP::Method::Accessor::_generate_predicate_method
31122µs24µsClass::MOP::Method::Accessor::::_generate_writer_methodClass::MOP::Method::Accessor::_generate_writer_method
11112µs15µsClass::MOP::Method::Accessor::::BEGIN@5Class::MOP::Method::Accessor::BEGIN@5
1119µs19µsClass::MOP::Method::Accessor::::BEGIN@4Class::MOP::Method::Accessor::BEGIN@4
1118µs1.54msClass::MOP::Method::Accessor::::BEGIN@10Class::MOP::Method::Accessor::BEGIN@10
1117µs8µsClass::MOP::Method::Accessor::::_generate_clearer_methodClass::MOP::Method::Accessor::_generate_clearer_method
1116µs31µsClass::MOP::Method::Accessor::::BEGIN@8Class::MOP::Method::Accessor::BEGIN@8
1115µs30µsClass::MOP::Method::Accessor::::BEGIN@7Class::MOP::Method::Accessor::BEGIN@7
0000s0sClass::MOP::Method::Accessor::::__ANON__[:105]Class::MOP::Method::Accessor::__ANON__[:105]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:121]Class::MOP::Method::Accessor::__ANON__[:121]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:127]Class::MOP::Method::Accessor::__ANON__[:127]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:142]Class::MOP::Method::Accessor::__ANON__[:142]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:163]Class::MOP::Method::Accessor::__ANON__[:163]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:169]Class::MOP::Method::Accessor::__ANON__[:169]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:183]Class::MOP::Method::Accessor::__ANON__[:183]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:196]Class::MOP::Method::Accessor::__ANON__[:196]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:202]Class::MOP::Method::Accessor::__ANON__[:202]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:211]Class::MOP::Method::Accessor::__ANON__[:211]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:224]Class::MOP::Method::Accessor::__ANON__[:224]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:230]Class::MOP::Method::Accessor::__ANON__[:230]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:239]Class::MOP::Method::Accessor::__ANON__[:239]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:252]Class::MOP::Method::Accessor::__ANON__[:252]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:258]Class::MOP::Method::Accessor::__ANON__[:258]
0000s0sClass::MOP::Method::Accessor::::_generate_clearer_method_inlineClass::MOP::Method::Accessor::_generate_clearer_method_inline
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::Method::Accessor;
21500nsour $VERSION = '2.1604';
3
4219µs228µs
# spent 19µs (9+10) within Class::MOP::Method::Accessor::BEGIN@4 which was called: # once (9µs+10µs) by Class::MOP::Class::BEGIN@9 at line 4
use strict;
# spent 19µs making 1 call to Class::MOP::Method::Accessor::BEGIN@4 # spent 10µs making 1 call to strict::import
5220µs218µs
# spent 15µs (12+3) within Class::MOP::Method::Accessor::BEGIN@5 which was called: # once (12µs+3µs) by Class::MOP::Class::BEGIN@9 at line 5
use warnings;
# spent 15µs making 1 call to Class::MOP::Method::Accessor::BEGIN@5 # spent 3µs making 1 call to warnings::import
6
7219µs255µs
# spent 30µs (5+25) within Class::MOP::Method::Accessor::BEGIN@7 which was called: # once (5µs+25µs) by Class::MOP::Class::BEGIN@9 at line 7
use Scalar::Util 'blessed', 'weaken';
# spent 30µs making 1 call to Class::MOP::Method::Accessor::BEGIN@7 # spent 25µs making 1 call to Exporter::import
8220µs255µs
# spent 31µs (6+24) within Class::MOP::Method::Accessor::BEGIN@8 which was called: # once (6µs+24µs) by Class::MOP::Class::BEGIN@9 at line 8
use Try::Tiny;
# spent 31µs making 1 call to Class::MOP::Method::Accessor::BEGIN@8 # spent 24µs making 1 call to Exporter::import
9
102869µs23.07ms
# spent 1.54ms (8µs+1.53) within Class::MOP::Method::Accessor::BEGIN@10 which was called: # once (8µs+1.53ms) by Class::MOP::Class::BEGIN@9 at line 10
use parent 'Class::MOP::Method::Generated';
# spent 1.54ms making 1 call to Class::MOP::Method::Accessor::BEGIN@10 # spent 1.53ms making 1 call to parent::import
11
12
# spent 256ms (11.9+244) within Class::MOP::Method::Accessor::new which was called 383 times, avg 669µs/call: # 196 times (9.00ms+209ms) by Class::MOP::Attribute::try {...} or Class::MOP::Class:::around at line 16 of Moose/Meta/Method/Accessor.pm, avg 1.11ms/call # 187 times (2.91ms+35.3ms) by Class::MOP::Attribute::try {...} at line 407 of Class/MOP/Attribute.pm, avg 204µs/call
sub new {
13383114µs my $class = shift;
14383918µs my %options = @_;
15
16383185µs (exists $options{attribute})
17 || $class->_throw_exception( MustSupplyAnAttributeToConstructWith => params => \%options,
18 class => $class,
19 );
20
21383127µs (exists $options{accessor_type})
22 || $class->_throw_exception( MustSupplyAnAccessorTypeToConstructWith => params => \%options,
23 class => $class,
24 );
25
263831.99ms766585µs (blessed($options{attribute}) && $options{attribute}->isa('Class::MOP::Attribute'))
# spent 316µs making 383 calls to Scalar::Util::blessed, avg 826ns/call # spent 268µs making 383 calls to UNIVERSAL::isa, avg 700ns/call
27 || $class->_throw_exception( MustSupplyAClassMOPAttributeInstance => params => \%options,
28 class => $class
29 );
30
31383217µs ($options{package_name} && $options{name})
32 || $class->_throw_exception( MustSupplyPackageNameAndName => params => \%options,
33 class => $class
34 );
35
36383637µs3831.47ms my $self = $class->_new(\%options);
# spent 1.08ms making 187 calls to Class::MOP::Method::Accessor::_new, avg 6µs/call # spent 200µs making 146 calls to Moose::Meta::Method::Accessor::_new, avg 1µs/call # spent 190µs making 50 calls to Moose::Meta::Method::Accessor::Native::_new, avg 4µs/call
37
38 # we don't want this creating
39 # a cycle in the code, if not
40 # needed
413832.67ms383343µs weaken($self->{'attribute'});
# spent 343µs making 383 calls to Scalar::Util::weaken, avg 895ns/call
42
433831.28ms383207ms $self->_initialize_body;
# spent 151ms making 333 calls to Class::MOP::Method::Accessor::_initialize_body, avg 455µs/call # spent 55.9ms making 50 calls to Moose::Meta::Method::Accessor::Native::_initialize_body, avg 1.12ms/call
44
453831.02ms return $self;
46}
47
48
# spent 36.1ms (2.21+33.8) within Class::MOP::Method::Accessor::_new which was called 403 times, avg 89µs/call: # 187 times (1.08ms+0s) by Class::MOP::Method::Accessor::new at line 36, avg 6µs/call # 146 times (812µs+33.8ms) by Class::MOP::Method::Accessor::new at line 20 of Moose/Meta/Method/Accessor.pm, avg 237µs/call # 70 times (320µs+0s) by Class::MOP::Method::wrap at line 49 of Class/MOP/Method.pm, avg 5µs/call
sub _new {
49403103µs my $class = shift;
50
51403725µs29233.8ms return Class::MOP::Class->initialize($class)->new_object(@_)
# spent 32.8ms making 146 calls to Class::MOP::Class::new_object, avg 225µs/call # spent 1.01ms making 146 calls to Class::MOP::Class::initialize, avg 7µs/call
52 if $class ne __PACKAGE__;
53
54257101µs my $params = @_ == 1 ? $_[0] : {@_};
55
562571.45ms return bless {
57 # inherited from Class::MOP::Method
58 body => $params->{body},
59 associated_metaclass => $params->{associated_metaclass},
60 package_name => $params->{package_name},
61 name => $params->{name},
62 original_method => $params->{original_method},
63
64 # inherit from Class::MOP::Generated
65 is_inline => $params->{is_inline} || 0,
66 definition_context => $params->{definition_context},
67
68 # defined in this class
69 attribute => $params->{attribute},
70 accessor_type => $params->{accessor_type},
71 } => $class;
72}
73
74## accessors
75
769631.99mssub associated_attribute { (shift)->{'attribute'} }
77333719µssub accessor_type { (shift)->{'accessor_type'} }
78
79## factory
80
81
# spent 151ms (3.02+148) within Class::MOP::Method::Accessor::_initialize_body which was called 333 times, avg 455µs/call: # 333 times (3.02ms+148ms) by Class::MOP::Method::Accessor::new at line 43, avg 455µs/call
sub _initialize_body {
8233369µs my $self = shift;
83
843331.39ms666599µs my $method_name = join "_" => (
# spent 366µs making 333 calls to Class::MOP::Method::Accessor::accessor_type, avg 1µs/call # spent 232µs making 333 calls to Class::MOP::Method::Generated::is_inline, avg 698ns/call
85 '_generate',
86 $self->accessor_type,
87 'method',
88 ($self->is_inline ? 'inline' : ())
89 );
90
913334.55ms333148ms $self->{'body'} = $self->$method_name();
# spent 96.9ms making 110 calls to Moose::Meta::Method::Accessor::_generate_reader_method, avg 881µs/call # spent 23.9ms making 55 calls to Class::MOP::Method::Accessor::_generate_reader_method_inline, avg 435µs/call # spent 15.4ms making 30 calls to Moose::Meta::Method::Accessor::_generate_predicate_method, avg 513µs/call # spent 5.10ms making 21 calls to Class::MOP::Method::Accessor::_generate_accessor_method_inline, avg 243µs/call # spent 2.92ms making 5 calls to Moose::Meta::Method::Accessor::_generate_writer_method, avg 584µs/call # spent 2.46ms making 15 calls to Class::MOP::Method::Accessor::_generate_predicate_method_inline, avg 164µs/call # spent 472µs making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method_inline, avg 157µs/call # spent 398µs making 54 calls to Class::MOP::Method::Accessor::_generate_reader_method, avg 7µs/call # spent 126µs making 21 calls to Class::MOP::Method::Accessor::_generate_accessor_method, avg 6µs/call # spent 94µs making 15 calls to Class::MOP::Method::Accessor::_generate_predicate_method, avg 6µs/call # spent 24µs making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method, avg 8µs/call # spent 8µs making 1 call to Class::MOP::Method::Accessor::_generate_clearer_method
92}
93
94## generators
95
96
# spent 126µs (112+14) within Class::MOP::Method::Accessor::_generate_accessor_method which was called 21 times, avg 6µs/call: # 21 times (112µs+14µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 6µs/call
sub _generate_accessor_method {
97215µs my $self = shift;
982117µs2114µs my $attr = $self->associated_attribute;
# spent 14µs making 21 calls to Class::MOP::Method::Accessor::associated_attribute, avg 681ns/call
99
100 return sub {
101 if (@_ >= 2) {
102 $attr->set_value($_[0], $_[1]);
103 }
104 $attr->get_value($_[0]);
1052182µs };
106}
107
108
# spent 5.10ms (207µs+4.90) within Class::MOP::Method::Accessor::_generate_accessor_method_inline which was called 21 times, avg 243µs/call: # 21 times (207µs+4.90ms) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 243µs/call
sub _generate_accessor_method_inline {
109215µs my $self = shift;
1102118µs2114µs my $attr = $self->associated_attribute;
# spent 14µs making 21 calls to Class::MOP::Method::Accessor::associated_attribute, avg 643ns/call
111
112 return try {
11321111µs634.36ms $self->_compile_code([
# spent 2.88ms making 21 calls to Class::MOP::Method::Generated::_compile_code, avg 137µs/call # spent 1.16ms making 21 calls to Class::MOP::Attribute::_inline_set_value, avg 55µs/call # spent 315µs making 21 calls to Class::MOP::Attribute::_inline_get_value, avg 15µs/call
114 'sub {',
115 'if (@_ > 1) {',
116 $attr->_inline_set_value('$_[0]', '$_[1]'),
117 '}',
118 $attr->_inline_get_value('$_[0]'),
119 '}',
120 ]);
121 }
122 catch {
123 $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self,
124 error => $_,
125 option => "accessor"
126 );
12721134µs4238µs };
# spent 38µs making 21 calls to Try::Tiny::catch, avg 2µs/call # spent 4.84ms making 21 calls to Try::Tiny::try, avg 231µs/call, recursion: max depth 1, sum of overlapping time 4.84ms
128}
129
130
# spent 398µs (343+55) within Class::MOP::Method::Accessor::_generate_reader_method which was called 54 times, avg 7µs/call: # 54 times (343µs+55µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 7µs/call
sub _generate_reader_method {
1315410µs my $self = shift;
1325436µs5434µs my $attr = $self->associated_attribute;
# spent 34µs making 54 calls to Class::MOP::Method::Accessor::associated_attribute, avg 633ns/call
13354103µs5421µs my $class = $attr->associated_class;
# spent 21µs making 54 calls to Class::MOP::Attribute::associated_class, avg 385ns/call
134
135 return sub {
136124µs $self->_throw_exception( CannotAssignValueToReadOnlyAccessor => class_name => $class->name,
137 value => $_[1],
138 attribute => $attr
139 )
140 if @_ > 1;
1411236µs12271µs $attr->get_value($_[0]);
# spent 271µs making 12 calls to Class::MOP::Attribute::get_value, avg 23µs/call
14254201µs };
143}
144
145
# spent 119ms (5.58+113) within Class::MOP::Method::Accessor::_generate_reader_method_inline which was called 165 times, avg 720µs/call: # 110 times (5.00ms+90.0ms) by Moose::Meta::Method::Accessor::_generate_reader_method at line 56 of Moose/Meta/Method/Accessor.pm, avg 863µs/call # 55 times (582µs+23.3ms) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 435µs/call
sub _generate_reader_method_inline {
14616550µs my $self = shift;
147165163µs16594µs my $attr = $self->associated_attribute;
# spent 94µs making 165 calls to Class::MOP::Method::Accessor::associated_attribute, avg 567ns/call
1481653.85ms16568µs my $attr_name = $attr->name;
# spent 68µs making 165 calls to Class::MOP::Mixin::AttributeCore::name, avg 412ns/call
149
150 return try {
1511651.23ms495104ms $self->_compile_code([
# spent 52.5ms making 111 calls to Moose::Meta::Method::Accessor::_compile_code, avg 473µs/call # spent 33.9ms making 111 calls to Moose::Meta::Attribute::_inline_get_value, avg 305µs/call # spent 15.3ms making 54 calls to Class::MOP::Method::Generated::_compile_code, avg 283µs/call # spent 2.35ms making 54 calls to Class::MOP::Attribute::_inline_get_value, avg 43µs/call # spent 367µs making 165 calls to Class::MOP::Method::Accessor::_inline_throw_exception, avg 2µs/call
152 'sub {',
153 'if (@_ > 1) {',
154 $self->_inline_throw_exception( CannotAssignValueToReadOnlyAccessor =>
155 'class_name => ref $_[0],'.
156 'value => $_[1],'.
157 "attribute_name => '".$attr_name."'",
158 ) . ';',
159 '}',
160 $attr->_inline_get_value('$_[0]'),
161 '}',
162 ]);
163 }
164 catch {
165 $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self,
166 error => $_,
167 option => "reader"
168 );
1691651.22ms330332µs };
# spent 332µs making 165 calls to Try::Tiny::catch, avg 2µs/call # spent 113ms making 165 calls to Try::Tiny::try, avg 683µs/call, recursion: max depth 2, sum of overlapping time 113ms
170}
171
172
# spent 519µs within Class::MOP::Method::Accessor::_inline_throw_exception which was called 235 times, avg 2µs/call: # 165 times (367µs+0s) by Class::MOP::Method::Accessor::try {...} at line 151, avg 2µs/call # 40 times (79µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 85 of Moose/Meta/Method/Accessor/Native.pm, avg 2µs/call # 11 times (32µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 74 of Moose/Meta/Method/Accessor/Native.pm, avg 3µs/call # 6 times (11µs+0s) by Moose::Meta::Method::Accessor::Native::Hash::_inline_check_var_is_valid_key at line 14 of Moose/Meta/Method/Accessor/Native/Hash.pm, avg 2µs/call # 5 times (15µs+0s) by Moose::Meta::Method::Accessor::Native::Collection::_inline_check_member_constraint at line 109 of Moose/Meta/Method/Accessor/Native/Collection.pm, avg 3µs/call # 3 times (4µs+0s) by Moose::Meta::Method::Accessor::Native::Hash::set::_inline_check_arguments at line 44 of Moose/Meta/Method/Accessor/Native/Hash/set.pm, avg 2µs/call # 3 times (4µs+0s) by Class::MOP::Class:::around at line 21 of Moose/Meta/Method/Accessor/Native/Hash/set.pm, avg 1µs/call # 2 times (6µs+0s) by Moose::Meta::Method::Accessor::Native::Array::_inline_check_var_is_valid_index at line 14 of Moose/Meta/Method/Accessor/Native/Array.pm, avg 3µs/call
sub _inline_throw_exception {
173235123µs my ( $self, $exception_type, $throw_args ) = @_;
174235686µs return 'die Module::Runtime::use_module("Moose::Exception::' . $exception_type . '")->new(' . ($throw_args || '') . ')';
175}
176
177
# spent 24µs (22+2) within Class::MOP::Method::Accessor::_generate_writer_method which was called 3 times, avg 8µs/call: # 3 times (22µs+2µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 8µs/call
sub _generate_writer_method {
1783900ns my $self = shift;
17933µs32µs my $attr = $self->associated_attribute;
# spent 2µs making 3 calls to Class::MOP::Method::Accessor::associated_attribute, avg 600ns/call
180
181 return sub {
182 $attr->set_value($_[0], $_[1]);
183313µs };
184}
185
186
# spent 3.30ms (98µs+3.20) within Class::MOP::Method::Accessor::_generate_writer_method_inline which was called 8 times, avg 413µs/call: # 5 times (62µs+2.77ms) by Moose::Meta::Method::Accessor::_generate_writer_method at line 62 of Moose/Meta/Method/Accessor.pm, avg 566µs/call # 3 times (36µs+436µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 157µs/call
sub _generate_writer_method_inline {
18783µs my $self = shift;
18887µs84µs my $attr = $self->associated_attribute;
# spent 4µs making 8 calls to Class::MOP::Method::Accessor::associated_attribute, avg 550ns/call
189
190 return try {
191835µs163.00ms $self->_compile_code([
# spent 1.78ms making 5 calls to Moose::Meta::Method::Accessor::_compile_code, avg 355µs/call # spent 847µs making 5 calls to Moose::Meta::Attribute::_inline_set_value, avg 169µs/call # spent 321µs making 3 calls to Class::MOP::Method::Generated::_compile_code, avg 107µs/call # spent 50µs making 3 calls to Class::MOP::Attribute::_inline_set_value, avg 17µs/call
192 'sub {',
193 $attr->_inline_set_value('$_[0]', '$_[1]'),
194 '}',
195 ]);
196 }
197 catch {
198 $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self,
199 error => $_,
200 option => "writer"
201 );
202860µs1616µs };
# spent 16µs making 8 calls to Try::Tiny::catch, avg 2µs/call # spent 3.18ms making 8 calls to Try::Tiny::try, avg 398µs/call, recursion: max depth 2, sum of overlapping time 3.18ms
203}
204
205
# spent 94µs (84+9) within Class::MOP::Method::Accessor::_generate_predicate_method which was called 15 times, avg 6µs/call: # 15 times (84µs+9µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 6µs/call
sub _generate_predicate_method {
206153µs my $self = shift;
2071514µs159µs my $attr = $self->associated_attribute;
# spent 9µs making 15 calls to Class::MOP::Method::Accessor::associated_attribute, avg 620ns/call
208
209 return sub {
2101235µs12235µs $attr->has_value($_[0])
# spent 235µs making 12 calls to Class::MOP::Attribute::has_value, avg 20µs/call
2111559µs };
212}
213
214
# spent 17.4ms (529µs+16.8) within Class::MOP::Method::Accessor::_generate_predicate_method_inline which was called 45 times, avg 386µs/call: # 30 times (382µs+14.5ms) by Moose::Meta::Method::Accessor::_generate_predicate_method at line 74 of Moose/Meta/Method/Accessor.pm, avg 497µs/call # 15 times (146µs+2.32ms) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 164µs/call
sub _generate_predicate_method_inline {
2154517µs my $self = shift;
2164549µs4529µs my $attr = $self->associated_attribute;
# spent 29µs making 45 calls to Class::MOP::Method::Accessor::associated_attribute, avg 649ns/call
217
218 return try {
21945201µs9015.7ms $self->_compile_code([
# spent 13.0ms making 30 calls to Moose::Meta::Method::Accessor::_compile_code, avg 435µs/call # spent 1.69ms making 15 calls to Class::MOP::Method::Generated::_compile_code, avg 113µs/call # spent 953µs making 45 calls to Class::MOP::Attribute::_inline_has_value, avg 21µs/call
220 'sub {',
221 $attr->_inline_has_value('$_[0]'),
222 '}',
223 ]);
224 }
225 catch {
226 $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self,
227 error => $_,
228 option => "predicate"
229 );
23045343µs9086µs };
# spent 86µs making 45 calls to Try::Tiny::catch, avg 2µs/call # spent 16.7ms making 45 calls to Try::Tiny::try, avg 372µs/call, recursion: max depth 2, sum of overlapping time 16.7ms
231}
232
233
# spent 8µs (7+2) within Class::MOP::Method::Accessor::_generate_clearer_method which was called: # once (7µs+2µs) by Class::MOP::Method::Accessor::_initialize_body at line 91
sub _generate_clearer_method {
2341300ns my $self = shift;
23512µs12µs my $attr = $self->associated_attribute;
236
237 return sub {
238 $attr->clear_value($_[0])
23914µs };
240}
241
242sub _generate_clearer_method_inline {
243 my $self = shift;
244 my $attr = $self->associated_attribute;
245
246 return try {
247 $self->_compile_code([
248 'sub {',
249 $attr->_inline_clear_value('$_[0]'),
250 '}',
251 ]);
252 }
253 catch {
254 $self->_throw_exception( CouldNotGenerateInlineAttributeMethod => instance => $self,
255 error => $_,
256 option => "clearer"
257 );
258 };
259}
260
26112µs1;
262
263# ABSTRACT: Method Meta Object for accessors
264
265__END__