Filename | /usr/local/lib/perl/5.14.2/Class/MOP/Method/Accessor.pm |
Statements | Executed 6148 statements in 16.2ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
252 | 2 | 2 | 4.68ms | 95.4ms | new | Class::MOP::Method::Accessor::
309 | 3 | 3 | 3.24ms | 15.3ms | _new | Class::MOP::Method::Accessor::
252 | 1 | 1 | 2.12ms | 76.0ms | _initialize_body | Class::MOP::Method::Accessor::
83 | 2 | 2 | 883µs | 34.0ms | _generate_reader_method_inline | Class::MOP::Method::Accessor::
52 | 2 | 2 | 561µs | 32.6ms | _generate_accessor_method_inline | Class::MOP::Method::Accessor::
53 | 1 | 1 | 329µs | 379µs | _generate_reader_method | Class::MOP::Method::Accessor::
18 | 2 | 2 | 191µs | 3.81ms | _generate_predicate_method_inline | Class::MOP::Method::Accessor::
22 | 1 | 1 | 134µs | 158µs | _generate_accessor_method | Class::MOP::Method::Accessor::
16 | 1 | 1 | 110µs | 125µs | _generate_predicate_method | Class::MOP::Method::Accessor::
53 | 1 | 1 | 87µs | 87µs | _inline_throw_error | Class::MOP::Method::Accessor::
3 | 1 | 1 | 40µs | 584µs | _generate_writer_method_inline | Class::MOP::Method::Accessor::
2 | 1 | 1 | 35µs | 763µs | _generate_clearer_method_inline | Class::MOP::Method::Accessor::
3 | 1 | 1 | 18µs | 21µs | _generate_writer_method | Class::MOP::Method::Accessor::
1 | 1 | 1 | 9µs | 9µs | BEGIN@3 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 7µs | 10µs | BEGIN@10 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 7µs | 176µs | BEGIN@14 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 7µs | 37µs | BEGIN@15 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 7µs | 12µs | BEGIN@11 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 7µs | 1.95ms | BEGIN@17 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 6µs | 33µs | BEGIN@13 | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:104] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:120] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:123] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:134] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:154] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:157] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:171] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:184] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:187] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:196] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:209] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:212] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:221] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:234] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:237] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | _generate_clearer_method | Class::MOP::Method::Accessor::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | |||||
2 | package Class::MOP::Method::Accessor; | ||||
3 | # spent 9µs within Class::MOP::Method::Accessor::BEGIN@3 which was called:
# once (9µs+0s) by Class::MOP::Class::BEGIN@15 at line 5 | ||||
4 | 1 | 5µs | $Class::MOP::Method::Accessor::AUTHORITY = 'cpan:STEVAN'; | ||
5 | 1 | 30µs | 1 | 9µs | } # spent 9µs making 1 call to Class::MOP::Method::Accessor::BEGIN@3 |
6 | { | ||||
7 | 2 | 1µs | $Class::MOP::Method::Accessor::VERSION = '2.1005'; | ||
8 | } | ||||
9 | |||||
10 | 2 | 22µs | 2 | 14µs | # spent 10µs (7+3) within Class::MOP::Method::Accessor::BEGIN@10 which was called:
# once (7µs+3µs) by Class::MOP::Class::BEGIN@15 at line 10 # spent 10µs making 1 call to Class::MOP::Method::Accessor::BEGIN@10
# spent 3µs making 1 call to strict::import |
11 | 2 | 22µs | 2 | 17µs | # spent 12µs (7+5) within Class::MOP::Method::Accessor::BEGIN@11 which was called:
# once (7µs+5µs) by Class::MOP::Class::BEGIN@15 at line 11 # spent 12µs making 1 call to Class::MOP::Method::Accessor::BEGIN@11
# spent 5µs making 1 call to warnings::import |
12 | |||||
13 | 2 | 26µs | 2 | 60µs | # spent 33µs (6+27) within Class::MOP::Method::Accessor::BEGIN@13 which was called:
# once (6µs+27µs) by Class::MOP::Class::BEGIN@15 at line 13 # spent 33µs making 1 call to Class::MOP::Method::Accessor::BEGIN@13
# spent 27µs making 1 call to Exporter::import |
14 | 2 | 47µs | 2 | 346µs | # spent 176µs (7+169) within Class::MOP::Method::Accessor::BEGIN@14 which was called:
# once (7µs+169µs) by Class::MOP::Class::BEGIN@15 at line 14 # spent 176µs making 1 call to Class::MOP::Method::Accessor::BEGIN@14
# spent 169µs making 1 call to Exporter::import |
15 | 2 | 24µs | 2 | 68µs | # spent 37µs (7+30) within Class::MOP::Method::Accessor::BEGIN@15 which was called:
# once (7µs+30µs) by Class::MOP::Class::BEGIN@15 at line 15 # spent 37µs making 1 call to Class::MOP::Method::Accessor::BEGIN@15
# spent 30µs making 1 call to Exporter::import |
16 | |||||
17 | 2 | 983µs | 2 | 3.88ms | # spent 1.95ms (7µs+1.94) within Class::MOP::Method::Accessor::BEGIN@17 which was called:
# once (7µs+1.94ms) by Class::MOP::Class::BEGIN@15 at line 17 # spent 1.95ms making 1 call to Class::MOP::Method::Accessor::BEGIN@17
# spent 1.94ms making 1 call to base::import |
18 | |||||
19 | # spent 95.4ms (4.68+90.8) within Class::MOP::Method::Accessor::new which was called 252 times, avg 379µs/call:
# 188 times (3.33ms+27.5ms) by Class::MOP::Attribute::try {...} at line 389 of Class/MOP/Attribute.pm, avg 164µs/call
# 64 times (1.35ms+63.3ms) by Class::MOP::Attribute::try {...} at line 20 of Moose/Meta/Method/Accessor.pm, avg 1.01ms/call | ||||
20 | 2520 | 5.04ms | my $class = shift; | ||
21 | my %options = @_; | ||||
22 | |||||
23 | (exists $options{attribute}) | ||||
24 | || confess "You must supply an attribute to construct with"; | ||||
25 | |||||
26 | (exists $options{accessor_type}) | ||||
27 | || confess "You must supply an accessor_type to construct with"; | ||||
28 | |||||
29 | 504 | 411µs | (blessed($options{attribute}) && $options{attribute}->isa('Class::MOP::Attribute')) # spent 207µs making 252 calls to UNIVERSAL::isa, avg 823ns/call
# spent 204µs making 252 calls to Scalar::Util::blessed, avg 809ns/call | ||
30 | || confess "You must supply an attribute which is a 'Class::MOP::Attribute' instance"; | ||||
31 | |||||
32 | ($options{package_name} && $options{name}) | ||||
33 | || confess "You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT"; | ||||
34 | |||||
35 | 252 | 1.68ms | my $self = $class->_new(\%options); # spent 1.61ms making 188 calls to Class::MOP::Method::Accessor::_new, avg 9µs/call
# spent 69µs making 64 calls to Moose::Meta::Method::Accessor::_new, avg 1µs/call | ||
36 | |||||
37 | # we don't want this creating | ||||
38 | # a cycle in the code, if not | ||||
39 | # needed | ||||
40 | 252 | 294µs | weaken($self->{'attribute'}); # spent 294µs making 252 calls to Scalar::Util::weaken, avg 1µs/call | ||
41 | |||||
42 | 252 | 76.0ms | $self->_initialize_body; # spent 76.0ms making 252 calls to Class::MOP::Method::Accessor::_initialize_body, avg 302µs/call | ||
43 | |||||
44 | return $self; | ||||
45 | } | ||||
46 | |||||
47 | # spent 15.3ms (3.24+12.0) within Class::MOP::Method::Accessor::_new which was called 309 times, avg 49µs/call:
# 188 times (1.61ms+0s) by Class::MOP::Method::Accessor::new at line 35, avg 9µs/call
# 64 times (340µs+12.0ms) by Class::MOP::Method::Accessor::new at line 24 of Moose/Meta/Method/Accessor.pm, avg 193µs/call
# 57 times (1.28ms+0s) by Class::MOP::Method::wrap at line 46 of Class/MOP/Method.pm, avg 23µs/call | ||||
48 | 1108 | 3.42ms | my $class = shift; | ||
49 | |||||
50 | 128 | 12.0ms | return Class::MOP::Class->initialize($class)->new_object(@_) # spent 11.2ms making 64 calls to Class::MOP::Class::new_object, avg 176µs/call
# spent 783µs making 64 calls to Class::MOP::Class::initialize, avg 12µs/call | ||
51 | if $class ne __PACKAGE__; | ||||
52 | |||||
53 | my $params = @_ == 1 ? $_[0] : {@_}; | ||||
54 | |||||
55 | return bless { | ||||
56 | # inherited from Class::MOP::Method | ||||
57 | body => $params->{body}, | ||||
58 | associated_metaclass => $params->{associated_metaclass}, | ||||
59 | package_name => $params->{package_name}, | ||||
60 | name => $params->{name}, | ||||
61 | original_method => $params->{original_method}, | ||||
62 | |||||
63 | # inherit from Class::MOP::Generated | ||||
64 | is_inline => $params->{is_inline} || 0, | ||||
65 | definition_context => $params->{definition_context}, | ||||
66 | |||||
67 | # defined in this class | ||||
68 | attribute => $params->{attribute}, | ||||
69 | accessor_type => $params->{accessor_type}, | ||||
70 | } => $class; | ||||
71 | } | ||||
72 | |||||
73 | ## accessors | ||||
74 | |||||
75 | 440 | 942µs | sub associated_attribute { (shift)->{'attribute'} } | ||
76 | 252 | 503µs | sub accessor_type { (shift)->{'accessor_type'} } | ||
77 | |||||
78 | ## factory | ||||
79 | |||||
80 | # spent 76.0ms (2.12+73.9) within Class::MOP::Method::Accessor::_initialize_body which was called 252 times, avg 302µs/call:
# 252 times (2.12ms+73.9ms) by Class::MOP::Method::Accessor::new at line 42, avg 302µs/call | ||||
81 | 756 | 2.05ms | my $self = shift; | ||
82 | |||||
83 | 504 | 454µs | my $method_name = join "_" => ( # spent 278µs making 252 calls to Class::MOP::Method::Accessor::accessor_type, avg 1µs/call
# spent 176µs making 252 calls to Class::MOP::Method::Generated::is_inline, avg 698ns/call | ||
84 | '_generate', | ||||
85 | $self->accessor_type, | ||||
86 | 'method', | ||||
87 | ($self->is_inline ? 'inline' : ()) | ||||
88 | ); | ||||
89 | |||||
90 | 252 | 73.4ms | $self->{'body'} = $self->$method_name(); # spent 26.8ms making 30 calls to Moose::Meta::Method::Accessor::_generate_accessor_method, avg 893µs/call
# spent 21.0ms making 29 calls to Moose::Meta::Method::Accessor::_generate_reader_method, avg 724µs/call
# spent 13.5ms making 54 calls to Class::MOP::Method::Accessor::_generate_reader_method_inline, avg 249µs/call
# spent 6.26ms making 22 calls to Class::MOP::Method::Accessor::_generate_accessor_method_inline, avg 285µs/call
# spent 3.13ms making 16 calls to Class::MOP::Method::Accessor::_generate_predicate_method_inline, avg 196µs/call
# spent 806µs making 2 calls to Moose::Meta::Method::Accessor::_generate_clearer_method, avg 403µs/call
# spent 722µs making 2 calls to Moose::Meta::Method::Accessor::_generate_predicate_method, avg 361µs/call
# spent 584µs making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method_inline, avg 195µs/call
# spent 379µs making 53 calls to Class::MOP::Method::Accessor::_generate_reader_method, avg 7µs/call
# spent 158µs making 22 calls to Class::MOP::Method::Accessor::_generate_accessor_method, avg 7µs/call
# spent 125µs making 16 calls to Class::MOP::Method::Accessor::_generate_predicate_method, avg 8µs/call
# spent 21µs making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method, avg 7µs/call | ||
91 | } | ||||
92 | |||||
93 | ## generators | ||||
94 | |||||
95 | # spent 158µs (134+24) within Class::MOP::Method::Accessor::_generate_accessor_method which was called 22 times, avg 7µs/call:
# 22 times (134µs+24µs) by Class::MOP::Method::Accessor::_initialize_body at line 90, avg 7µs/call | ||||
96 | 66 | 130µs | my $self = shift; | ||
97 | 22 | 24µs | my $attr = $self->associated_attribute; # spent 24µs making 22 calls to Class::MOP::Method::Accessor::associated_attribute, avg 1µs/call | ||
98 | |||||
99 | return sub { | ||||
100 | if (@_ >= 2) { | ||||
101 | $attr->set_value($_[0], $_[1]); | ||||
102 | } | ||||
103 | $attr->get_value($_[0]); | ||||
104 | }; | ||||
105 | } | ||||
106 | |||||
107 | # spent 32.6ms (561µs+32.0) within Class::MOP::Method::Accessor::_generate_accessor_method_inline which was called 52 times, avg 627µs/call:
# 30 times (337µs+26.0ms) by Moose::Meta::Method::Accessor::_generate_accessor_method at line 74 of Moose/Meta/Method/Accessor.pm, avg 878µs/call
# 22 times (224µs+6.04ms) by Class::MOP::Method::Accessor::_initialize_body at line 90, avg 285µs/call | ||||
108 | 156 | 442µs | my $self = shift; | ||
109 | 52 | 44µs | my $attr = $self->associated_attribute; # spent 44µs making 52 calls to Class::MOP::Method::Accessor::associated_attribute, avg 840ns/call | ||
110 | |||||
111 | return try { | ||||
112 | 52 | 311µs | 156 | 30.3ms | $self->_compile_code([ # spent 12.3ms making 30 calls to Moose::Meta::Attribute::_inline_set_value, avg 410µs/call
# spent 11.6ms making 30 calls to Moose::Meta::Method::Accessor::_compile_code, avg 386µs/call
# spent 3.46ms making 22 calls to Class::MOP::Method::Generated::_compile_code, avg 157µs/call
# spent 1.52ms making 22 calls to Class::MOP::Attribute::_inline_set_value, avg 69µs/call
# spent 1.06ms making 30 calls to Moose::Meta::Attribute::_inline_get_value, avg 35µs/call
# spent 380µs making 22 calls to Class::MOP::Attribute::_inline_get_value, avg 17µs/call |
113 | 'sub {', | ||||
114 | 'if (@_ > 1) {', | ||||
115 | $attr->_inline_set_value('$_[0]', '$_[1]'), | ||||
116 | '}', | ||||
117 | $attr->_inline_get_value('$_[0]'), | ||||
118 | '}', | ||||
119 | ]); | ||||
120 | } | ||||
121 | catch { | ||||
122 | confess "Could not generate inline accessor because : $_"; | ||||
123 | 104 | 155µs | }; # spent 155µs making 52 calls to Try::Tiny::catch, avg 3µs/call
# spent 31.8ms making 52 calls to Try::Tiny::try, avg 612µs/call, recursion: max depth 2, sum of overlapping time 31.8ms | ||
124 | } | ||||
125 | |||||
126 | # spent 379µs (329+50) within Class::MOP::Method::Accessor::_generate_reader_method which was called 53 times, avg 7µs/call:
# 53 times (329µs+50µs) by Class::MOP::Method::Accessor::_initialize_body at line 90, avg 7µs/call | ||||
127 | 159 | 307µs | my $self = shift; | ||
128 | 53 | 50µs | my $attr = $self->associated_attribute; # spent 50µs making 53 calls to Class::MOP::Method::Accessor::associated_attribute, avg 942ns/call | ||
129 | |||||
130 | return sub { | ||||
131 | 24 | 40µs | confess "Cannot assign a value to a read-only accessor" | ||
132 | if @_ > 1; | ||||
133 | 12 | 291µs | $attr->get_value($_[0]); # spent 291µs making 12 calls to Class::MOP::Attribute::get_value, avg 24µs/call | ||
134 | }; | ||||
135 | } | ||||
136 | |||||
137 | # spent 34.0ms (883µs+33.1) within Class::MOP::Method::Accessor::_generate_reader_method_inline which was called 83 times, avg 409µs/call:
# 54 times (543µs+12.9ms) by Class::MOP::Method::Accessor::_initialize_body at line 90, avg 249µs/call
# 29 times (340µs+20.2ms) by Moose::Meta::Method::Accessor::_generate_reader_method at line 62 of Moose/Meta/Method/Accessor.pm, avg 708µs/call | ||||
138 | 249 | 713µs | my $self = shift; | ||
139 | 83 | 72µs | my $attr = $self->associated_attribute; # spent 72µs making 83 calls to Class::MOP::Method::Accessor::associated_attribute, avg 867ns/call | ||
140 | |||||
141 | return try { | ||||
142 | 83 | 530µs | 249 | 30.3ms | $self->_compile_code([ # spent 10.1ms making 30 calls to Moose::Meta::Method::Accessor::_compile_code, avg 337µs/call
# spent 8.13ms making 53 calls to Class::MOP::Method::Generated::_compile_code, avg 153µs/call
# spent 5.34ms making 30 calls to Moose::Meta::Attribute::_inline_get_value, avg 178µs/call
# spent 4.15ms making 30 calls to Moose::Meta::Method::_inline_throw_error, avg 138µs/call
# spent 2.48ms making 53 calls to Class::MOP::Attribute::_inline_get_value, avg 47µs/call
# spent 87µs making 53 calls to Class::MOP::Method::Accessor::_inline_throw_error, avg 2µs/call |
143 | 'sub {', | ||||
144 | 'if (@_ > 1) {', | ||||
145 | # XXX: this is a hack, but our error stuff is terrible | ||||
146 | $self->_inline_throw_error( | ||||
147 | '"Cannot assign a value to a read-only accessor"', | ||||
148 | 'data => \@_' | ||||
149 | ) . ';', | ||||
150 | '}', | ||||
151 | $attr->_inline_get_value('$_[0]'), | ||||
152 | '}', | ||||
153 | ]); | ||||
154 | } | ||||
155 | catch { | ||||
156 | confess "Could not generate inline reader because : $_"; | ||||
157 | 166 | 268µs | }; # spent 268µs making 83 calls to Try::Tiny::catch, avg 3µs/call
# spent 32.8ms making 83 calls to Try::Tiny::try, avg 395µs/call, recursion: max depth 2, sum of overlapping time 32.8ms | ||
158 | } | ||||
159 | |||||
160 | # spent 87µs within Class::MOP::Method::Accessor::_inline_throw_error which was called 53 times, avg 2µs/call:
# 53 times (87µs+0s) by Class::MOP::Method::Accessor::try {...} at line 142, avg 2µs/call | ||||
161 | 106 | 136µs | my $self = shift; | ||
162 | return 'Carp::confess ' . $_[0]; | ||||
163 | } | ||||
164 | |||||
165 | # spent 21µs (18+3) within Class::MOP::Method::Accessor::_generate_writer_method which was called 3 times, avg 7µs/call:
# 3 times (18µs+3µs) by Class::MOP::Method::Accessor::_initialize_body at line 90, avg 7µs/call | ||||
166 | 9 | 17µs | my $self = shift; | ||
167 | 3 | 3µs | my $attr = $self->associated_attribute; # spent 3µs making 3 calls to Class::MOP::Method::Accessor::associated_attribute, avg 1µs/call | ||
168 | |||||
169 | return sub { | ||||
170 | $attr->set_value($_[0], $_[1]); | ||||
171 | }; | ||||
172 | } | ||||
173 | |||||
174 | # spent 584µs (40+544) within Class::MOP::Method::Accessor::_generate_writer_method_inline which was called 3 times, avg 195µs/call:
# 3 times (40µs+544µs) by Class::MOP::Method::Accessor::_initialize_body at line 90, avg 195µs/call | ||||
175 | 9 | 29µs | my $self = shift; | ||
176 | 3 | 3µs | my $attr = $self->associated_attribute; # spent 3µs making 3 calls to Class::MOP::Method::Accessor::associated_attribute, avg 967ns/call | ||
177 | |||||
178 | return try { | ||||
179 | 3 | 14µs | 6 | 459µs | $self->_compile_code([ # spent 399µs making 3 calls to Class::MOP::Method::Generated::_compile_code, avg 133µs/call
# spent 60µs making 3 calls to Class::MOP::Attribute::_inline_set_value, avg 20µs/call |
180 | 'sub {', | ||||
181 | $attr->_inline_set_value('$_[0]', '$_[1]'), | ||||
182 | '}', | ||||
183 | ]); | ||||
184 | } | ||||
185 | catch { | ||||
186 | confess "Could not generate inline writer because : $_"; | ||||
187 | 6 | 8µs | }; # spent 8µs making 3 calls to Try::Tiny::catch, avg 3µs/call
# spent 533µs making 3 calls to Try::Tiny::try, avg 178µs/call, recursion: max depth 1, sum of overlapping time 533µs | ||
188 | } | ||||
189 | |||||
190 | # spent 125µs (110+15) within Class::MOP::Method::Accessor::_generate_predicate_method which was called 16 times, avg 8µs/call:
# 16 times (110µs+15µs) by Class::MOP::Method::Accessor::_initialize_body at line 90, avg 8µs/call | ||||
191 | 48 | 108µs | my $self = shift; | ||
192 | 16 | 15µs | my $attr = $self->associated_attribute; # spent 15µs making 16 calls to Class::MOP::Method::Accessor::associated_attribute, avg 931ns/call | ||
193 | |||||
194 | return sub { | ||||
195 | 12 | 34µs | 12 | 252µs | $attr->has_value($_[0]) # spent 252µs making 12 calls to Class::MOP::Attribute::has_value, avg 21µs/call |
196 | }; | ||||
197 | } | ||||
198 | |||||
199 | # spent 3.81ms (191µs+3.61) within Class::MOP::Method::Accessor::_generate_predicate_method_inline which was called 18 times, avg 211µs/call:
# 16 times (164µs+2.97ms) by Class::MOP::Method::Accessor::_initialize_body at line 90, avg 196µs/call
# 2 times (27µs+648µs) by Moose::Meta::Method::Accessor::_generate_predicate_method at line 80 of Moose/Meta/Method/Accessor.pm, avg 337µs/call | ||||
200 | 54 | 149µs | my $self = shift; | ||
201 | 18 | 16µs | my $attr = $self->associated_attribute; # spent 16µs making 18 calls to Class::MOP::Method::Accessor::associated_attribute, avg 917ns/call | ||
202 | |||||
203 | return try { | ||||
204 | 18 | 79µs | 36 | 3.11ms | $self->_compile_code([ # spent 2.20ms making 16 calls to Class::MOP::Method::Generated::_compile_code, avg 137µs/call
# spent 539µs making 2 calls to Moose::Meta::Method::Accessor::_compile_code, avg 270µs/call
# spent 370µs making 18 calls to Class::MOP::Attribute::_inline_has_value, avg 21µs/call |
205 | 'sub {', | ||||
206 | $attr->_inline_has_value('$_[0]'), | ||||
207 | '}', | ||||
208 | ]); | ||||
209 | } | ||||
210 | catch { | ||||
211 | confess "Could not generate inline predicate because : $_"; | ||||
212 | 36 | 49µs | }; # spent 49µs making 18 calls to Try::Tiny::catch, avg 3µs/call
# spent 3.55ms making 18 calls to Try::Tiny::try, avg 197µs/call, recursion: max depth 2, sum of overlapping time 3.55ms | ||
213 | } | ||||
214 | |||||
215 | sub _generate_clearer_method { | ||||
216 | my $self = shift; | ||||
217 | my $attr = $self->associated_attribute; | ||||
218 | |||||
219 | return sub { | ||||
220 | $attr->clear_value($_[0]) | ||||
221 | }; | ||||
222 | } | ||||
223 | |||||
224 | # spent 763µs (35+728) within Class::MOP::Method::Accessor::_generate_clearer_method_inline which was called 2 times, avg 381µs/call:
# 2 times (35µs+728µs) by Moose::Meta::Method::Accessor::_generate_clearer_method at line 86 of Moose/Meta/Method/Accessor.pm, avg 381µs/call | ||||
225 | 6 | 28µs | my $self = shift; | ||
226 | 2 | 2µs | my $attr = $self->associated_attribute; # spent 2µs making 2 calls to Class::MOP::Method::Accessor::associated_attribute, avg 800ns/call | ||
227 | |||||
228 | return try { | ||||
229 | 2 | 17µs | 4 | 654µs | $self->_compile_code([ # spent 593µs making 2 calls to Moose::Meta::Method::Accessor::_compile_code, avg 296µs/call
# spent 61µs making 2 calls to Class::MOP::Attribute::_inline_clear_value, avg 31µs/call |
230 | 'sub {', | ||||
231 | $attr->_inline_clear_value('$_[0]'), | ||||
232 | '}', | ||||
233 | ]); | ||||
234 | } | ||||
235 | catch { | ||||
236 | confess "Could not generate inline clearer because : $_"; | ||||
237 | 4 | 6µs | }; # spent 6µs making 2 calls to Try::Tiny::catch, avg 3µs/call
# spent 720µs making 2 calls to Try::Tiny::try, avg 360µs/call, recursion: max depth 2, sum of overlapping time 720µs | ||
238 | } | ||||
239 | |||||
240 | 1 | 3µs | 1; | ||
241 | |||||
242 | # ABSTRACT: Method Meta Object for accessors | ||||
243 | |||||
244 | __END__ |