← 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:57 2010

Filename/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm
StatementsExecuted 6299 statements in 110ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2692232.9ms597msClass::MOP::Method::Accessor::::newClass::MOP::Method::Accessor::new
2262215.7ms15.7msClass::MOP::Method::Accessor::::_newClass::MOP::Method::Accessor::_new
2551115.1ms448msClass::MOP::Method::Accessor::::_initialize_bodyClass::MOP::Method::Accessor::_initialize_body
115227.80ms285msClass::MOP::Method::Accessor::::_generate_reader_method_inlineClass::MOP::Method::Accessor::_generate_reader_method_inline
115117.30ms263msClass::MOP::Method::Accessor::::__ANON__[:152]Class::MOP::Method::Accessor::__ANON__[:152]
54111.94ms2.39msClass::MOP::Method::Accessor::::_generate_reader_methodClass::MOP::Method::Accessor::_generate_reader_method
26221.76ms76.6msClass::MOP::Method::Accessor::::_generate_accessor_method_inlineClass::MOP::Method::Accessor::_generate_accessor_method_inline
26111.48ms71.7msClass::MOP::Method::Accessor::::__ANON__[:118]Class::MOP::Method::Accessor::__ANON__[:118]
20221.32ms30.5msClass::MOP::Method::Accessor::::_generate_predicate_method_inlineClass::MOP::Method::Accessor::_generate_predicate_method_inline
2011783µs26.8msClass::MOP::Method::Accessor::::__ANON__[:207]Class::MOP::Method::Accessor::__ANON__[:207]
5311766µs766µsClass::MOP::Method::Accessor::::_inline_throw_errorClass::MOP::Method::Accessor::_inline_throw_error
1511625µs766µsClass::MOP::Method::Accessor::::_generate_accessor_methodClass::MOP::Method::Accessor::_generate_accessor_method
922625µs21.2msClass::MOP::Method::Accessor::::_generate_writer_method_inlineClass::MOP::Method::Accessor::_generate_writer_method_inline
1311555µs674µsClass::MOP::Method::Accessor::::_generate_predicate_methodClass::MOP::Method::Accessor::_generate_predicate_method
911450µs19.3msClass::MOP::Method::Accessor::::__ANON__[:182]Class::MOP::Method::Accessor::__ANON__[:182]
311100µs125µsClass::MOP::Method::Accessor::::_generate_writer_methodClass::MOP::Method::Accessor::_generate_writer_method
11177µs96µsClass::MOP::Method::Accessor::::BEGIN@4Class::MOP::Method::Accessor::BEGIN@4
11143µs30.6msClass::MOP::Method::Accessor::::BEGIN@15Class::MOP::Method::Accessor::BEGIN@15
11141µs111µsClass::MOP::Method::Accessor::::BEGIN@5Class::MOP::Method::Accessor::BEGIN@5
11139µs220µsClass::MOP::Method::Accessor::::BEGIN@9Class::MOP::Method::Accessor::BEGIN@9
11138µs232µsClass::MOP::Method::Accessor::::BEGIN@8Class::MOP::Method::Accessor::BEGIN@8
11137µs196µsClass::MOP::Method::Accessor::::BEGIN@7Class::MOP::Method::Accessor::BEGIN@7
0000s0sClass::MOP::Method::Accessor::::__ANON__[:102]Class::MOP::Method::Accessor::__ANON__[:102]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:121]Class::MOP::Method::Accessor::__ANON__[:121]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:132]Class::MOP::Method::Accessor::__ANON__[:132]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:155]Class::MOP::Method::Accessor::__ANON__[:155]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:169]Class::MOP::Method::Accessor::__ANON__[:169]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:185]Class::MOP::Method::Accessor::__ANON__[:185]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:194]Class::MOP::Method::Accessor::__ANON__[:194]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:210]Class::MOP::Method::Accessor::__ANON__[:210]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:219]Class::MOP::Method::Accessor::__ANON__[:219]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:232]Class::MOP::Method::Accessor::__ANON__[:232]
0000s0sClass::MOP::Method::Accessor::::__ANON__[:235]Class::MOP::Method::Accessor::__ANON__[:235]
0000s0sClass::MOP::Method::Accessor::::_generate_clearer_methodClass::MOP::Method::Accessor::_generate_clearer_method
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
1
2package Class::MOP::Method::Accessor;
3
43121µs2115µs
# spent 96µs (77+19) within Class::MOP::Method::Accessor::BEGIN@4 which was called: # once (77µs+19µs) by Class::MOP::Class::BEGIN@9 at line 4
use strict;
# spent 96µs making 1 call to Class::MOP::Method::Accessor::BEGIN@4 # spent 19µs making 1 call to strict::import
53109µs2180µs
# spent 111µs (41+70) within Class::MOP::Method::Accessor::BEGIN@5 which was called: # once (41µs+70µs) by Class::MOP::Class::BEGIN@9 at line 5
use warnings;
# spent 111µs making 1 call to Class::MOP::Method::Accessor::BEGIN@5 # spent 70µs making 1 call to warnings::import
6
73133µs2356µs
# spent 196µs (37+160) within Class::MOP::Method::Accessor::BEGIN@7 which was called: # once (37µs+160µs) by Class::MOP::Class::BEGIN@9 at line 7
use Carp 'confess';
# spent 196µs making 1 call to Class::MOP::Method::Accessor::BEGIN@7 # spent 160µs making 1 call to Exporter::import
83104µs2426µs
# spent 232µs (38+194) within Class::MOP::Method::Accessor::BEGIN@8 which was called: # once (38µs+194µs) by Class::MOP::Class::BEGIN@9 at line 8
use Scalar::Util 'blessed', 'weaken';
# spent 232µs making 1 call to Class::MOP::Method::Accessor::BEGIN@8 # spent 194µs making 1 call to Exporter::import
93227µs2401µs
# spent 220µs (39+181) within Class::MOP::Method::Accessor::BEGIN@9 which was called: # once (39µs+181µs) by Class::MOP::Class::BEGIN@9 at line 9
use Try::Tiny;
# spent 220µs making 1 call to Class::MOP::Method::Accessor::BEGIN@9 # spent 181µs making 1 call to Exporter::import
10
1116µsour $VERSION = '1.11';
12164µs$VERSION = eval $VERSION;
# spent 14µs executing statements in string eval
1314µsour $AUTHORITY = 'cpan:STEVAN';
14
1533.89ms230.6ms
# spent 30.6ms (43µs+30.6) within Class::MOP::Method::Accessor::BEGIN@15 which was called: # once (43µs+30.6ms) by Class::MOP::Class::BEGIN@9 at line 15
use base 'Class::MOP::Method::Generated';
# spent 30.6ms making 1 call to Class::MOP::Method::Accessor::BEGIN@15 # spent 30.6ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 30.6ms
16
17
# spent 597ms (32.9+564) within Class::MOP::Method::Accessor::new which was called 269 times, avg 2.22ms/call: # 255 times (31.2ms+480ms) 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.00ms/call # 14 times (1.68ms+83.9ms) by Class::MOP::Class:::around at line 31 of Moose/Meta/Method/Accessor/Native.pm, avg 6.11ms/call
sub new {
18269038.2ms 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
275383.97ms (blessed($options{attribute}) && $options{attribute}->isa('Class::MOP::Attribute'))
# spent 2.11ms making 269 calls to Scalar::Util::blessed, avg 8µs/call # spent 1.86ms making 269 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
3326937.6ms my $self = $class->_new(\%options);
# spent 11.5ms making 14 calls to Moose::Meta::Method::Accessor::Native::_new, avg 820µs/call # spent 9.15ms making 169 calls to Class::MOP::Method::Accessor::_new, avg 54µs/call # spent 8.48ms making 2 calls to Class::MOP::Method::_new, avg 4.24ms/call # spent 8.46ms making 84 calls to Moose::Meta::Method::Accessor::_new, avg 101µs/call
34
35 # we don't want this creating
36 # a cycle in the code, if not
37 # needed
382692.39ms weaken($self->{'attribute'});
# spent 2.39ms making 269 calls to Scalar::Util::weaken, avg 9µs/call
39
40269520ms $self->_initialize_body;
# spent 448ms making 255 calls to Class::MOP::Method::Accessor::_initialize_body, avg 1.76ms/call # spent 72.1ms making 14 calls to Moose::Meta::Method::Accessor::Native::_initialize_body, avg 5.15ms/call
41
42 return $self;
43}
44
45
# spent 15.7ms within Class::MOP::Method::Accessor::_new which was called 226 times, avg 69µs/call: # 169 times (9.15ms+0s) by Class::MOP::Method::Accessor::new at line 33, avg 54µs/call # 57 times (6.52ms+0s) by Class::MOP::Method::wrap at line 44 of Class/MOP/Method.pm, avg 114µs/call
sub _new {
4690416.6ms 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
735868.26mssub associated_attribute { (shift)->{'attribute'} }
742553.55mssub accessor_type { (shift)->{'accessor_type'} }
75
76## factory
77
78
# spent 448ms (15.1+433) within Class::MOP::Method::Accessor::_initialize_body which was called 255 times, avg 1.76ms/call: # 255 times (15.1ms+433ms) by Class::MOP::Method::Accessor::new at line 40, avg 1.76ms/call
sub _initialize_body {
7976515.7ms my $self = shift;
80
815104.14ms my $method_name = join "_" => (
# spent 2.53ms making 255 calls to Class::MOP::Method::Accessor::accessor_type, avg 10µs/call # spent 1.61ms making 255 calls to Class::MOP::Method::Generated::is_inline, avg 6µs/call
82 '_generate',
83 $self->accessor_type,
84 'method',
85 ($self->is_inline ? 'inline' : ())
86 );
87
88255429ms $self->{'body'} = $self->$method_name();
# spent 214ms making 61 calls to Moose::Meta::Method::Accessor::_generate_reader_method, avg 3.51ms/call # spent 79.2ms making 54 calls to Class::MOP::Method::Accessor::_generate_reader_method_inline, avg 1.47ms/call # spent 50.0ms making 11 calls to Moose::Meta::Method::Accessor::_generate_accessor_method, avg 4.55ms/call # spent 28.1ms making 15 calls to Class::MOP::Method::Accessor::_generate_accessor_method_inline, avg 1.87ms/call # spent 18.1ms making 6 calls to Moose::Meta::Method::Accessor::_generate_writer_method, avg 3.02ms/call # spent 16.1ms making 13 calls to Class::MOP::Method::Accessor::_generate_predicate_method_inline, avg 1.24ms/call # spent 15.3ms making 7 calls to Moose::Meta::Method::Accessor::_generate_predicate_method, avg 2.19ms/call # spent 3.81ms making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method_inline, avg 1.27ms/call # spent 2.39ms making 54 calls to Class::MOP::Method::Accessor::_generate_reader_method, avg 44µs/call # spent 766µs making 15 calls to Class::MOP::Method::Accessor::_generate_accessor_method, avg 51µs/call # spent 674µs making 13 calls to Class::MOP::Method::Accessor::_generate_predicate_method, avg 52µs/call # spent 125µs making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method, avg 42µs/call
89}
90
91## generators
92
93
# spent 766µs (625+140) within Class::MOP::Method::Accessor::_generate_accessor_method which was called 15 times, avg 51µs/call: # 15 times (625µs+140µs) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 51µs/call
sub _generate_accessor_method {
9445601µs my $self = shift;
9515140µs my $attr = $self->associated_attribute;
# spent 140µs making 15 calls to Class::MOP::Method::Accessor::associated_attribute, avg 9µ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 76.6ms (1.76+74.8) within Class::MOP::Method::Accessor::_generate_accessor_method_inline which was called 26 times, avg 2.95ms/call: # 15 times (1.01ms+27.1ms) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 1.87ms/call # 11 times (752µs+47.8ms) by Moose::Meta::Method::Accessor::_generate_accessor_method at line 76 of Moose/Meta/Method/Accessor.pm, avg 4.41ms/call
sub _generate_accessor_method_inline {
106781.50ms my $self = shift;
10726216µs my $attr = $self->associated_attribute;
# spent 216µs making 26 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call
108
109
# spent 71.7ms (1.48+70.2) within Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:118] which was called 26 times, avg 2.76ms/call: # 26 times (1.48ms+70.2ms) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 2.76ms/call
return try {
110261.31ms7870.2ms $self->_compile_code([
# spent 26.5ms making 11 calls to Moose::Meta::Attribute::_inline_set_value, avg 2.41ms/call # spent 15.4ms making 11 calls to Moose::Meta::Method::Accessor::_compile_code, avg 1.40ms/call # spent 13.6ms making 15 calls to Class::MOP::Method::Generated::_compile_code, avg 907µs/call # spent 8.80ms making 15 calls to Class::MOP::Attribute::_inline_set_value, avg 587µs/call # spent 3.75ms making 11 calls to Moose::Meta::Attribute::_inline_get_value, avg 341µs/call # spent 2.10ms making 15 calls to Class::MOP::Attribute::_inline_get_value, avg 140µ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 : $_";
12152444µs };
# spent 444µs making 26 calls to Try::Tiny::catch, avg 17µs/call # spent 74.2ms making 26 calls to Try::Tiny::try, avg 2.85ms/call, recursion: max depth 3, sum of overlapping time 74.2ms
122}
123
124
# spent 2.39ms (1.94+454µs) within Class::MOP::Method::Accessor::_generate_reader_method which was called 54 times, avg 44µs/call: # 54 times (1.94ms+454µs) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 44µs/call
sub _generate_reader_method {
1251621.86ms my $self = shift;
12654454µs my $attr = $self->associated_attribute;
# spent 454µs making 54 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call
127
128 return sub {
12928427µs confess "Cannot assign a value to a read-only accessor"
130 if @_ > 1;
131143.01ms $attr->get_value($_[0]);
# spent 3.01ms making 14 calls to Class::MOP::Attribute::get_value, avg 215µs/call
132 };
133}
134
135
# spent 285ms (7.80+278) within Class::MOP::Method::Accessor::_generate_reader_method_inline which was called 115 times, avg 2.48ms/call: # 61 times (4.21ms+202ms) by Moose::Meta::Method::Accessor::_generate_reader_method at line 64 of Moose/Meta/Method/Accessor.pm, avg 3.38ms/call # 54 times (3.60ms+75.6ms) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 1.47ms/call
sub _generate_reader_method_inline {
1363456.56ms my $self = shift;
137115955µs my $attr = $self->associated_attribute;
# spent 955µs making 115 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call
138
139
# spent 263ms (7.30+256) within Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:152] which was called 115 times, avg 2.29ms/call: # 115 times (7.30ms+256ms) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 2.29ms/call
return try {
1401156.13ms345256ms $self->_compile_code([
# spent 107ms making 62 calls to Moose::Meta::Method::Accessor::_compile_code, avg 1.72ms/call # spent 83.7ms making 62 calls to Moose::Meta::Attribute::_inline_get_value, avg 1.35ms/call # spent 44.2ms making 53 calls to Class::MOP::Method::Generated::_compile_code, avg 835µs/call # spent 19.3ms making 53 calls to Class::MOP::Attribute::_inline_get_value, avg 364µs/call # spent 1.11ms making 62 calls to Moose::Meta::Method::_inline_throw_error, avg 18µs/call # spent 766µ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 : $_";
1552302.01ms };
# spent 2.01ms making 115 calls to Try::Tiny::catch, avg 17µs/call # spent 275ms making 115 calls to Try::Tiny::try, avg 2.39ms/call, recursion: max depth 3, sum of overlapping time 275ms
156}
157
158
# spent 766µs within Class::MOP::Method::Accessor::_inline_throw_error which was called 53 times, avg 14µs/call: # 53 times (766µ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
sub _inline_throw_error {
1591061.06ms my $self = shift;
160 return 'confess ' . $_[0];
161}
162
163
# spent 125µs (100+24) within Class::MOP::Method::Accessor::_generate_writer_method which was called 3 times, avg 42µs/call: # 3 times (100µs+24µs) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 42µs/call
sub _generate_writer_method {
164993µs my $self = shift;
165324µs my $attr = $self->associated_attribute;
# spent 24µs making 3 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call
166
167 return sub {
168 $attr->set_value($_[0], $_[1]);
169 };
170}
171
172
# spent 21.2ms (625µs+20.5) within Class::MOP::Method::Accessor::_generate_writer_method_inline which was called 9 times, avg 2.35ms/call: # 6 times (425µs+16.9ms) by Moose::Meta::Method::Accessor::_generate_writer_method at line 70 of Moose/Meta/Method/Accessor.pm, avg 2.89ms/call # 3 times (199µs+3.61ms) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 1.27ms/call
sub _generate_writer_method_inline {
17327516µs my $self = shift;
174972µs my $attr = $self->associated_attribute;
# spent 72µs making 9 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call
175
176
# spent 19.3ms (450µs+18.9) within Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:182] which was called 9 times, avg 2.15ms/call: # 9 times (450µs+18.9ms) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 2.15ms/call
return try {
1779390µs1818.9ms $self->_compile_code([
# spent 11.0ms making 6 calls to Moose::Meta::Method::Accessor::_compile_code, avg 1.83ms/call # spent 4.77ms making 6 calls to Moose::Meta::Attribute::_inline_set_value, avg 794µs/call # spent 2.57ms making 3 calls to Class::MOP::Method::Generated::_compile_code, avg 856µs/call # spent 565µs making 3 calls to Class::MOP::Attribute::_inline_set_value, avg 188µs/call
178 'sub {',
179 $attr->_inline_set_value('$_[0]', '$_[1]'),
180 '}',
181 ]);
182 }
183 catch {
184 confess "Could not generate inline writer because : $_";
18518152µs };
# spent 152µs making 9 calls to Try::Tiny::catch, avg 17µs/call # spent 20.3ms making 9 calls to Try::Tiny::try, avg 2.26ms/call, recursion: max depth 2, sum of overlapping time 20.3ms
186}
187
188
# spent 674µs (555+119) within Class::MOP::Method::Accessor::_generate_predicate_method which was called 13 times, avg 52µs/call: # 13 times (555µs+119µs) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 52µs/call
sub _generate_predicate_method {
18939496µs my $self = shift;
19013119µs my $attr = $self->associated_attribute;
# spent 119µs making 13 calls to Class::MOP::Method::Accessor::associated_attribute, avg 9µs/call
191
192 return sub {
1938197µs81.59ms $attr->has_value($_[0])
# spent 1.59ms making 8 calls to Class::MOP::Attribute::has_value, avg 199µs/call
194 };
195}
196
197
# spent 30.5ms (1.32+29.2) within Class::MOP::Method::Accessor::_generate_predicate_method_inline which was called 20 times, avg 1.53ms/call: # 13 times (842µs+15.3ms) by Class::MOP::Method::Accessor::_initialize_body at line 88, avg 1.24ms/call # 7 times (477µs+13.9ms) by Moose::Meta::Method::Accessor::_generate_predicate_method at line 82 of Moose/Meta/Method/Accessor.pm, avg 2.06ms/call
sub _generate_predicate_method_inline {
198601.11ms my $self = shift;
19920231µs my $attr = $self->associated_attribute;
# spent 231µs making 20 calls to Class::MOP::Method::Accessor::associated_attribute, avg 12µs/call
200
201
# spent 26.8ms (783µs+26.0) within Class::MOP::Method::Accessor::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP/Method/Accessor.pm:207] which was called 20 times, avg 1.34ms/call: # 20 times (783µs+26.0ms) by Try::Tiny::try at line 71 of Try/Tiny.pm, avg 1.34ms/call
return try {
20220704µs4026.0ms $self->_compile_code([
# spent 11.7ms making 7 calls to Moose::Meta::Method::Accessor::_compile_code, avg 1.67ms/call # spent 11.1ms making 13 calls to Class::MOP::Method::Generated::_compile_code, avg 858µs/call # spent 3.17ms making 20 calls to Class::MOP::Attribute::_inline_has_value, avg 159µs/call
203 'sub {',
204 $attr->_inline_has_value('$_[0]'),
205 '}',
206 ]);
207 }
208 catch {
209 confess "Could not generate inline predicate because : $_";
21040335µs };
# spent 335µs making 20 calls to Try::Tiny::catch, avg 17µs/call # spent 28.6ms making 20 calls to Try::Tiny::try, avg 1.43ms/call, recursion: max depth 3, sum of overlapping time 28.6ms
211}
212
213sub _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
222sub _generate_clearer_method_inline {
223 my $self = shift;
224 my $attr = $self->associated_attribute;
225
226 return try {
227 $self->_compile_code([
228 'sub {',
229 $attr->_inline_clear_value('$_[0]'),
230 '}',
231 ]);
232 }
233 catch {
234 confess "Could not generate inline clearer because : $_";
235 };
236}
237
238112µs1;
239
240__END__