Filename | /Users/ap13/perl5/lib/perl5/darwin-2level/Class/MOP/Method/Accessor.pm |
Statements | Executed 9935 statements in 31.5ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
394 | 2 | 2 | 9.70ms | 260ms | new | Class::MOP::Method::Accessor::
464 | 3 | 3 | 5.45ms | 47.8ms | _new | Class::MOP::Method::Accessor::
394 | 1 | 1 | 4.25ms | 203ms | _initialize_body | Class::MOP::Method::Accessor::
195 | 2 | 2 | 2.84ms | 124ms | _generate_reader_method_inline | Class::MOP::Method::Accessor::
71 | 2 | 2 | 914µs | 58.5ms | _generate_accessor_method_inline | Class::MOP::Method::Accessor::
195 | 1 | 1 | 589µs | 589µs | _inline_throw_exception | Class::MOP::Method::Accessor::
54 | 1 | 1 | 498µs | 596µs | _generate_reader_method | Class::MOP::Method::Accessor::
23 | 2 | 2 | 275µs | 5.79ms | _generate_predicate_method_inline | Class::MOP::Method::Accessor::
21 | 1 | 1 | 134µs | 157µs | _generate_accessor_method | Class::MOP::Method::Accessor::
8 | 1 | 1 | 104µs | 2.94ms | _generate_clearer_method_inline | Class::MOP::Method::Accessor::
15 | 1 | 1 | 92µs | 106µs | _generate_predicate_method | Class::MOP::Method::Accessor::
3 | 1 | 1 | 46µs | 669µs | _generate_writer_method_inline | Class::MOP::Method::Accessor::
3 | 1 | 1 | 25µs | 28µs | _generate_writer_method | Class::MOP::Method::Accessor::
1 | 1 | 1 | 21µs | 44µs | BEGIN@4 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 18µs | 25µs | BEGIN@5 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 15µs | 72µs | BEGIN@8 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 14µs | 7.05ms | BEGIN@10 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 13µs | 62µs | BEGIN@7 | Class::MOP::Method::Accessor::
1 | 1 | 1 | 10µs | 12µs | _generate_clearer_method | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:105] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:121] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:127] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:142] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:163] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:169] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:183] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:196] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:202] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:211] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:224] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:230] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:239] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:252] | Class::MOP::Method::Accessor::
0 | 0 | 0 | 0s | 0s | __ANON__[:258] | Class::MOP::Method::Accessor::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Class::MOP::Method::Accessor; | ||||
2 | 1 | 1µs | our $VERSION = '2.1403'; | ||
3 | |||||
4 | 2 | 45µs | 2 | 68µs | # spent 44µs (21+24) within Class::MOP::Method::Accessor::BEGIN@4 which was called:
# once (21µs+24µs) by Class::MOP::Class::BEGIN@9 at line 4 # spent 44µs making 1 call to Class::MOP::Method::Accessor::BEGIN@4
# spent 24µs making 1 call to strict::import |
5 | 2 | 44µs | 2 | 32µs | # spent 25µs (18+7) within Class::MOP::Method::Accessor::BEGIN@5 which was called:
# once (18µs+7µs) by Class::MOP::Class::BEGIN@9 at line 5 # spent 25µs making 1 call to Class::MOP::Method::Accessor::BEGIN@5
# spent 7µs making 1 call to warnings::import |
6 | |||||
7 | 2 | 45µs | 2 | 112µs | # spent 62µs (13+49) within Class::MOP::Method::Accessor::BEGIN@7 which was called:
# once (13µs+49µs) by Class::MOP::Class::BEGIN@9 at line 7 # spent 62µs making 1 call to Class::MOP::Method::Accessor::BEGIN@7
# spent 49µs making 1 call to Exporter::import |
8 | 2 | 43µs | 2 | 129µs | # spent 72µs (15+57) within Class::MOP::Method::Accessor::BEGIN@8 which was called:
# once (15µs+57µs) by Class::MOP::Class::BEGIN@9 at line 8 # spent 72µs making 1 call to Class::MOP::Method::Accessor::BEGIN@8
# spent 57µs making 1 call to Exporter::import |
9 | |||||
10 | 2 | 1.73ms | 2 | 14.1ms | # spent 7.05ms (14µs+7.04) within Class::MOP::Method::Accessor::BEGIN@10 which was called:
# once (14µs+7.04ms) by Class::MOP::Class::BEGIN@9 at line 10 # spent 7.05ms making 1 call to Class::MOP::Method::Accessor::BEGIN@10
# spent 7.04ms making 1 call to parent::import |
11 | |||||
12 | # spent 260ms (9.70+250) within Class::MOP::Method::Accessor::new which was called 394 times, avg 659µs/call:
# 207 times (5.53ms+217ms) by Class::MOP::Attribute::try {...} at line 16 of Moose/Meta/Method/Accessor.pm, avg 1.07ms/call
# 187 times (4.17ms+33.1ms) by Class::MOP::Attribute::try {...} at line 407 of Class/MOP/Attribute.pm, avg 199µs/call | ||||
13 | 394 | 148µs | my $class = shift; | ||
14 | 394 | 1.16ms | my %options = @_; | ||
15 | |||||
16 | 394 | 181µs | (exists $options{attribute}) | ||
17 | || $class->_throw_exception( MustSupplyAnAttributeToConstructWith => params => \%options, | ||||
18 | class => $class, | ||||
19 | ); | ||||
20 | |||||
21 | 394 | 114µs | (exists $options{accessor_type}) | ||
22 | || $class->_throw_exception( MustSupplyAnAccessorTypeToConstructWith => params => \%options, | ||||
23 | class => $class, | ||||
24 | ); | ||||
25 | |||||
26 | 394 | 2.38ms | 788 | 742µs | (blessed($options{attribute}) && $options{attribute}->isa('Class::MOP::Attribute')) # spent 392µs making 394 calls to Scalar::Util::blessed, avg 995ns/call
# spent 350µs making 394 calls to UNIVERSAL::isa, avg 887ns/call |
27 | || $class->_throw_exception( MustSupplyAClassMOPAttributeInstance => params => \%options, | ||||
28 | class => $class | ||||
29 | ); | ||||
30 | |||||
31 | 394 | 184µs | ($options{package_name} && $options{name}) | ||
32 | || $class->_throw_exception( MustSupplyPackageNameAndName => params => \%options, | ||||
33 | class => $class | ||||
34 | ); | ||||
35 | |||||
36 | 394 | 1.06ms | 394 | 2.19ms | my $self = $class->_new(\%options); # spent 1.89ms making 187 calls to Class::MOP::Method::Accessor::_new, avg 10µs/call
# spent 303µs making 207 calls to Moose::Meta::Method::Accessor::_new, avg 1µs/call |
37 | |||||
38 | # we don't want this creating | ||||
39 | # a cycle in the code, if not | ||||
40 | # needed | ||||
41 | 394 | 1.31ms | 394 | 484µs | weaken($self->{'attribute'}); # spent 484µs making 394 calls to Scalar::Util::weaken, avg 1µs/call |
42 | |||||
43 | 394 | 1.84ms | 394 | 203ms | $self->_initialize_body; # spent 203ms making 394 calls to Class::MOP::Method::Accessor::_initialize_body, avg 514µs/call |
44 | |||||
45 | 394 | 1.40ms | return $self; | ||
46 | } | ||||
47 | |||||
48 | # spent 47.8ms (5.45+42.4) within Class::MOP::Method::Accessor::_new which was called 464 times, avg 103µs/call:
# 207 times (1.50ms+42.4ms) by Class::MOP::Method::Accessor::new at line 20 of Moose/Meta/Method/Accessor.pm, avg 212µs/call
# 187 times (1.89ms+0s) by Class::MOP::Method::Accessor::new at line 36, avg 10µs/call
# 70 times (2.06ms+0s) by Class::MOP::Method::wrap at line 45 of Class/MOP/Method.pm, avg 29µs/call | ||||
49 | 464 | 170µs | my $class = shift; | ||
50 | |||||
51 | 464 | 1.24ms | 414 | 42.4ms | return Class::MOP::Class->initialize($class)->new_object(@_) # spent 40.6ms making 207 calls to Class::MOP::Class::new_object, avg 196µs/call
# spent 1.75ms making 207 calls to Class::MOP::Class::initialize, avg 8µs/call |
52 | if $class ne __PACKAGE__; | ||||
53 | |||||
54 | 257 | 152µs | my $params = @_ == 1 ? $_[0] : {@_}; | ||
55 | |||||
56 | 257 | 3.81ms | 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 | |||||
76 | 808 | 1.92ms | sub associated_attribute { (shift)->{'attribute'} } | ||
77 | 394 | 913µs | sub accessor_type { (shift)->{'accessor_type'} } | ||
78 | |||||
79 | ## factory | ||||
80 | |||||
81 | # spent 203ms (4.25+198) within Class::MOP::Method::Accessor::_initialize_body which was called 394 times, avg 514µs/call:
# 394 times (4.25ms+198ms) by Class::MOP::Method::Accessor::new at line 43, avg 514µs/call | ||||
82 | 394 | 125µs | my $self = shift; | ||
83 | |||||
84 | 394 | 1.95ms | 788 | 851µs | my $method_name = join "_" => ( # spent 553µs making 394 calls to Class::MOP::Method::Accessor::accessor_type, avg 1µs/call
# spent 298µs making 394 calls to Class::MOP::Method::Generated::is_inline, avg 756ns/call |
85 | '_generate', | ||||
86 | $self->accessor_type, | ||||
87 | 'method', | ||||
88 | ($self->is_inline ? 'inline' : ()) | ||||
89 | ); | ||||
90 | |||||
91 | 394 | 1.94ms | 394 | 198ms | $self->{'body'} = $self->$method_name(); # spent 111ms making 140 calls to Moose::Meta::Method::Accessor::_generate_reader_method, avg 790µs/call
# spent 52.3ms making 50 calls to Moose::Meta::Method::Accessor::_generate_accessor_method, avg 1.05ms/call
# spent 16.7ms making 55 calls to Class::MOP::Method::Accessor::_generate_reader_method_inline, avg 304µs/call
# spent 7.42ms making 21 calls to Class::MOP::Method::Accessor::_generate_accessor_method_inline, avg 354µs/call
# spent 3.10ms making 8 calls to Moose::Meta::Method::Accessor::_generate_clearer_method, avg 387µs/call
# spent 3.08ms making 15 calls to Class::MOP::Method::Accessor::_generate_predicate_method_inline, avg 206µs/call
# spent 2.87ms making 8 calls to Moose::Meta::Method::Accessor::_generate_predicate_method, avg 359µs/call
# spent 669µs making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method_inline, avg 223µs/call
# spent 596µs making 54 calls to Class::MOP::Method::Accessor::_generate_reader_method, avg 11µs/call
# spent 157µs making 21 calls to Class::MOP::Method::Accessor::_generate_accessor_method, avg 7µs/call
# spent 106µs making 15 calls to Class::MOP::Method::Accessor::_generate_predicate_method, avg 7µs/call
# spent 28µs making 3 calls to Class::MOP::Method::Accessor::_generate_writer_method, avg 9µs/call
# spent 12µs making 1 call to Class::MOP::Method::Accessor::_generate_clearer_method |
92 | } | ||||
93 | |||||
94 | ## generators | ||||
95 | |||||
96 | # spent 157µs (134+23) within Class::MOP::Method::Accessor::_generate_accessor_method which was called 21 times, avg 7µs/call:
# 21 times (134µs+23µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 7µs/call | ||||
97 | 21 | 6µs | my $self = shift; | ||
98 | 21 | 25µs | 21 | 23µs | my $attr = $self->associated_attribute; # spent 23µs making 21 calls to Class::MOP::Method::Accessor::associated_attribute, avg 1µs/call |
99 | |||||
100 | return sub { | ||||
101 | if (@_ >= 2) { | ||||
102 | $attr->set_value($_[0], $_[1]); | ||||
103 | } | ||||
104 | $attr->get_value($_[0]); | ||||
105 | 21 | 85µs | }; | ||
106 | } | ||||
107 | |||||
108 | # spent 58.5ms (914µs+57.6) within Class::MOP::Method::Accessor::_generate_accessor_method_inline which was called 71 times, avg 824µs/call:
# 50 times (636µs+50.4ms) by Moose::Meta::Method::Accessor::_generate_accessor_method at line 68 of Moose/Meta/Method/Accessor.pm, avg 1.02ms/call
# 21 times (278µs+7.15ms) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 354µs/call | ||||
109 | 71 | 27µs | my $self = shift; | ||
110 | 71 | 87µs | 71 | 76µs | my $attr = $self->associated_attribute; # spent 76µs making 71 calls to Class::MOP::Method::Accessor::associated_attribute, avg 1µs/call |
111 | |||||
112 | return try { | ||||
113 | 71 | 600µs | 213 | 54.5ms | $self->_compile_code([ # spent 24.9ms making 50 calls to Moose::Meta::Method::Accessor::_compile_code, avg 499µs/call
# spent 19.3ms making 50 calls to Moose::Meta::Attribute::_inline_set_value, avg 386µs/call
# spent 3.95ms making 50 calls to Moose::Meta::Attribute::_inline_get_value, avg 79µs/call
# spent 3.93ms making 21 calls to Class::MOP::Method::Generated::_compile_code, avg 187µs/call
# spent 1.90ms making 21 calls to Class::MOP::Attribute::_inline_set_value, avg 90µs/call
# spent 505µs making 21 calls to Class::MOP::Attribute::_inline_get_value, avg 24µ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 | ); | ||||
127 | 71 | 569µs | 142 | 204µs | }; # spent 204µs making 71 calls to Try::Tiny::catch, avg 3µs/call
# spent 57.3ms making 71 calls to Try::Tiny::try, avg 807µs/call, recursion: max depth 2, sum of overlapping time 57.3ms |
128 | } | ||||
129 | |||||
130 | # spent 596µs (498+98) within Class::MOP::Method::Accessor::_generate_reader_method which was called 54 times, avg 11µs/call:
# 54 times (498µs+98µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 11µs/call | ||||
131 | 54 | 16µs | my $self = shift; | ||
132 | 54 | 67µs | 54 | 66µs | my $attr = $self->associated_attribute; # spent 66µs making 54 calls to Class::MOP::Method::Accessor::associated_attribute, avg 1µs/call |
133 | 54 | 149µs | 54 | 32µs | my $class = $attr->associated_class; # spent 32µs making 54 calls to Class::MOP::Attribute::associated_class, avg 593ns/call |
134 | |||||
135 | return sub { | ||||
136 | 12 | 5µs | $self->_throw_exception( CannotAssignValueToReadOnlyAccessor => class_name => $class->name, | ||
137 | value => $_[1], | ||||
138 | attribute => $attr | ||||
139 | ) | ||||
140 | if @_ > 1; | ||||
141 | 12 | 46µs | 12 | 357µs | $attr->get_value($_[0]); # spent 357µs making 12 calls to Class::MOP::Attribute::get_value, avg 30µs/call |
142 | 54 | 244µs | }; | ||
143 | } | ||||
144 | |||||
145 | # spent 124ms (2.84+121) within Class::MOP::Method::Accessor::_generate_reader_method_inline which was called 195 times, avg 638µs/call:
# 140 times (2.04ms+106ms) by Moose::Meta::Method::Accessor::_generate_reader_method at line 56 of Moose/Meta/Method/Accessor.pm, avg 769µs/call
# 55 times (800µs+15.9ms) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 304µs/call | ||||
146 | 195 | 78µs | my $self = shift; | ||
147 | 195 | 248µs | 195 | 194µs | my $attr = $self->associated_attribute; # spent 194µs making 195 calls to Class::MOP::Method::Accessor::associated_attribute, avg 995ns/call |
148 | 195 | 568µs | 195 | 113µs | my $attr_name = $attr->name; # spent 113µs making 195 calls to Class::MOP::Mixin::AttributeCore::name, avg 581ns/call |
149 | |||||
150 | return try { | ||||
151 | 195 | 1.92ms | 585 | 113ms | $self->_compile_code([ # spent 61.4ms making 141 calls to Moose::Meta::Method::Accessor::_compile_code, avg 436µs/call
# spent 37.9ms making 141 calls to Moose::Meta::Attribute::_inline_get_value, avg 269µs/call
# spent 10.0ms making 54 calls to Class::MOP::Method::Generated::_compile_code, avg 186µs/call
# spent 3.12ms making 54 calls to Class::MOP::Attribute::_inline_get_value, avg 58µs/call
# spent 589µs making 195 calls to Class::MOP::Method::Accessor::_inline_throw_exception, avg 3µ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 | ); | ||||
169 | 195 | 1.48ms | 390 | 536µs | }; # spent 536µs making 195 calls to Try::Tiny::catch, avg 3µs/call
# spent 121ms making 195 calls to Try::Tiny::try, avg 619µs/call, recursion: max depth 2, sum of overlapping time 121ms |
170 | } | ||||
171 | |||||
172 | # spent 589µs within Class::MOP::Method::Accessor::_inline_throw_exception which was called 195 times, avg 3µs/call:
# 195 times (589µs+0s) by Class::MOP::Method::Accessor::try {...} at line 151, avg 3µs/call | ||||
173 | 195 | 148µs | my ( $self, $exception_type, $throw_args ) = @_; | ||
174 | 195 | 602µs | return 'die Module::Runtime::use_module("Moose::Exception::' . $exception_type . '")->new(' . ($throw_args || '') . ')'; | ||
175 | } | ||||
176 | |||||
177 | # spent 28µs (25+3) within Class::MOP::Method::Accessor::_generate_writer_method which was called 3 times, avg 9µs/call:
# 3 times (25µs+3µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 9µs/call | ||||
178 | 3 | 1µs | my $self = shift; | ||
179 | 3 | 4µs | 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 |
180 | |||||
181 | return sub { | ||||
182 | $attr->set_value($_[0], $_[1]); | ||||
183 | 3 | 18µs | }; | ||
184 | } | ||||
185 | |||||
186 | # spent 669µs (46+623) within Class::MOP::Method::Accessor::_generate_writer_method_inline which was called 3 times, avg 223µs/call:
# 3 times (46µs+623µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 223µs/call | ||||
187 | 3 | 2µs | my $self = shift; | ||
188 | 3 | 5µs | 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 |
189 | |||||
190 | return try { | ||||
191 | 3 | 16µs | 6 | 525µs | $self->_compile_code([ # spent 451µs making 3 calls to Class::MOP::Method::Generated::_compile_code, avg 150µs/call
# spent 73µs making 3 calls to Class::MOP::Attribute::_inline_set_value, avg 24µ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 | ); | ||||
202 | 3 | 28µs | 6 | 8µs | }; # spent 8µs making 3 calls to Try::Tiny::catch, avg 3µs/call
# spent 612µs making 3 calls to Try::Tiny::try, avg 204µs/call, recursion: max depth 1, sum of overlapping time 612µs |
203 | } | ||||
204 | |||||
205 | # spent 106µs (92+15) within Class::MOP::Method::Accessor::_generate_predicate_method which was called 15 times, avg 7µs/call:
# 15 times (92µs+15µs) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 7µs/call | ||||
206 | 15 | 5µs | my $self = shift; | ||
207 | 15 | 18µs | 15 | 15µs | my $attr = $self->associated_attribute; # spent 15µs making 15 calls to Class::MOP::Method::Accessor::associated_attribute, avg 980ns/call |
208 | |||||
209 | return sub { | ||||
210 | 12 | 40µs | 12 | 299µs | $attr->has_value($_[0]) # spent 299µs making 12 calls to Class::MOP::Attribute::has_value, avg 25µs/call |
211 | 15 | 56µs | }; | ||
212 | } | ||||
213 | |||||
214 | # spent 5.79ms (275µs+5.51) within Class::MOP::Method::Accessor::_generate_predicate_method_inline which was called 23 times, avg 252µs/call:
# 15 times (176µs+2.91ms) by Class::MOP::Method::Accessor::_initialize_body at line 91, avg 206µs/call
# 8 times (99µs+2.60ms) by Moose::Meta::Method::Accessor::_generate_predicate_method at line 74 of Moose/Meta/Method/Accessor.pm, avg 338µs/call | ||||
215 | 23 | 9µs | my $self = shift; | ||
216 | 23 | 30µs | 23 | 22µs | my $attr = $self->associated_attribute; # spent 22µs making 23 calls to Class::MOP::Method::Accessor::associated_attribute, avg 978ns/call |
217 | |||||
218 | return try { | ||||
219 | 23 | 115µs | 46 | 4.78ms | $self->_compile_code([ # spent 2.14ms making 8 calls to Moose::Meta::Method::Accessor::_compile_code, avg 268µs/call
# spent 2.06ms making 15 calls to Class::MOP::Method::Generated::_compile_code, avg 137µs/call
# spent 579µs making 23 calls to Class::MOP::Attribute::_inline_has_value, avg 25µ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 | ); | ||||
230 | 23 | 168µs | 46 | 58µs | }; # spent 58µs making 23 calls to Try::Tiny::catch, avg 3µs/call
# spent 5.43ms making 23 calls to Try::Tiny::try, avg 236µs/call, recursion: max depth 2, sum of overlapping time 5.43ms |
231 | } | ||||
232 | |||||
233 | # spent 12µs (10+2) within Class::MOP::Method::Accessor::_generate_clearer_method which was called:
# once (10µs+2µs) by Class::MOP::Method::Accessor::_initialize_body at line 91 | ||||
234 | 1 | 500ns | my $self = shift; | ||
235 | 1 | 2µs | 1 | 2µs | my $attr = $self->associated_attribute; # spent 2µs making 1 call to Class::MOP::Method::Accessor::associated_attribute |
236 | |||||
237 | return sub { | ||||
238 | $attr->clear_value($_[0]) | ||||
239 | 1 | 5µs | }; | ||
240 | } | ||||
241 | |||||
242 | # spent 2.94ms (104µs+2.83) within Class::MOP::Method::Accessor::_generate_clearer_method_inline which was called 8 times, avg 367µs/call:
# 8 times (104µs+2.83ms) by Moose::Meta::Method::Accessor::_generate_clearer_method at line 80 of Moose/Meta/Method/Accessor.pm, avg 367µs/call | ||||
243 | 8 | 4µs | my $self = shift; | ||
244 | 8 | 12µs | 8 | 7µs | my $attr = $self->associated_attribute; # spent 7µs making 8 calls to Class::MOP::Method::Accessor::associated_attribute, avg 862ns/call |
245 | |||||
246 | return try { | ||||
247 | 8 | 50µs | 16 | 2.55ms | $self->_compile_code([ # spent 2.34ms making 8 calls to Moose::Meta::Method::Accessor::_compile_code, avg 292µs/call
# spent 212µs making 8 calls to Class::MOP::Attribute::_inline_clear_value, avg 26µs/call |
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 | 8 | 68µs | 16 | 20µs | }; # spent 20µs making 8 calls to Try::Tiny::catch, avg 2µs/call
# spent 2.80ms making 8 calls to Try::Tiny::try, avg 351µs/call, recursion: max depth 2, sum of overlapping time 2.80ms |
259 | } | ||||
260 | |||||
261 | 1 | 5µs | 1; | ||
262 | |||||
263 | # ABSTRACT: Method Meta Object for accessors | ||||
264 | |||||
265 | __END__ |