Filename | /home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/x86_64-linux/Mouse/Meta/Module.pm |
Statements | Executed 1443 statements in 6.03ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
138 | 4 | 4 | 1.17ms | 2.46ms | has_method | Mouse::Meta::Module::
134 | 2 | 1 | 1.02ms | 1.33ms | _get_method_body | Mouse::Meta::Module::
6 | 1 | 1 | 714µs | 2.87ms | get_method_list | Mouse::Meta::Module::
82 | 14 | 4 | 582µs | 1.08ms | initialize (recurses: max depth 1, inclusive time 46µs) | Mouse::Meta::Module::
87 | 9 | 6 | 579µs | 579µs | add_method (xsub) | Mouse::Meta::Module::
60 | 6 | 4 | 203µs | 203µs | _get_metaclass_by_name | Mouse::Meta::Module::
3 | 1 | 1 | 199µs | 627µs | create | Mouse::Meta::Module::
57 | 6 | 3 | 77µs | 77µs | name (xsub) | Mouse::Meta::Module::
20 | 1 | 1 | 61µs | 61µs | get_attribute | Mouse::Meta::Module::
4 | 3 | 1 | 52µs | 52µs | _collect_methods | Mouse::Meta::Module::
10 | 1 | 1 | 35µs | 35µs | has_attribute | Mouse::Meta::Module::
9 | 1 | 1 | 34µs | 34µs | get_attribute_list | Mouse::Meta::Module::
1 | 1 | 1 | 25µs | 102µs | BEGIN@2 | Mouse::Meta::Module::
2 | 1 | 1 | 23µs | 51µs | get_method_body | Mouse::Meta::Module::
3 | 1 | 1 | 20µs | 20µs | _class_of | Mouse::Meta::Module::
6 | 1 | 1 | 16µs | 16µs | namespace (xsub) | Mouse::Meta::Module::
1 | 1 | 1 | 14µs | 36µs | BEGIN@303 | Mouse::Meta::Module::
1 | 1 | 1 | 11µs | 33µs | BEGIN@224 | Mouse::Meta::Module::
1 | 1 | 1 | 7µs | 7µs | BEGIN@4 | Mouse::Meta::Module::
1 | 1 | 1 | 5µs | 5µs | BEGIN@5 | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | DESTROY | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | __ANON__[:14] | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | __ANON__[:236] | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | _get_all_metaclass_instances | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | _get_all_metaclass_names | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | _metaclass_cache | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | get_attribute_map | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | get_method | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | reinitialize | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | remove_attribute | Mouse::Meta::Module::
0 | 0 | 0 | 0s | 0s | meta | Mouse::Meta::Role::Composite::__ANON__::1::
0 | 0 | 0 | 0s | 0s | meta | Mouse::Meta::Role::Composite::__ANON__::2::
0 | 0 | 0 | 0s | 0s | meta | Mouse::Meta::Role::Composite::__ANON__::3::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Mouse::Meta::Module; | ||||
2 | 2 | 28µs | 2 | 180µs | # spent 102µs (25+78) within Mouse::Meta::Module::BEGIN@2 which was called:
# once (25µs+78µs) by Mouse::BEGIN@4 at line 2 # spent 102µs making 1 call to Mouse::Meta::Module::BEGIN@2
# spent 78µs making 1 call to Mouse::Exporter::do_import |
3 | |||||
4 | 2 | 21µs | 1 | 7µs | # spent 7µs within Mouse::Meta::Module::BEGIN@4 which was called:
# once (7µs+0s) by Mouse::BEGIN@4 at line 4 # spent 7µs making 1 call to Mouse::Meta::Module::BEGIN@4 |
5 | 2 | 921µs | 1 | 5µs | # spent 5µs within Mouse::Meta::Module::BEGIN@5 which was called:
# once (5µs+0s) by Mouse::BEGIN@4 at line 5 # spent 5µs making 1 call to Mouse::Meta::Module::BEGIN@5 |
6 | |||||
7 | 1 | 1µs | my %METAS; | ||
8 | |||||
9 | 1 | 2µs | if(Mouse::Util::MOUSE_XS){ | ||
10 | # register meta storage for performance | ||||
11 | 1 | 9µs | 1 | 2µs | Mouse::Util::__register_metaclass_storage(\%METAS, 0); # spent 2µs making 1 call to Mouse::Util::__register_metaclass_storage |
12 | |||||
13 | # ensure thread safety | ||||
14 | 1 | 3µs | *CLONE = sub { Mouse::Util::__register_metaclass_storage(\%METAS, 1) }; | ||
15 | } | ||||
16 | |||||
17 | sub _metaclass_cache { # DEPRECATED | ||||
18 | my($self, $name) = @_; | ||||
19 | Carp::cluck('_metaclass_cache() has been deprecated. Use Mouse::Util::get_metaclass_by_name() instead'); | ||||
20 | return $METAS{$name}; | ||||
21 | } | ||||
22 | |||||
23 | # spent 1.08ms (582µs+499µs) within Mouse::Meta::Module::initialize which was called 82 times, avg 13µs/call:
# 26 times (158µs+0s) by Mouse::has at line 45 of Mouse.pm, avg 6µs/call
# 11 times (61µs+0s) by Mouse::Role::requires at line 98 of Mouse/Role.pm, avg 6µs/call
# 9 times (89µs+136µs) by Mouse::init_meta at line 133 of Mouse.pm, avg 25µs/call
# 8 times (51µs+0s) by Mouse::Role::has at line 37 of Mouse/Role.pm, avg 6µs/call
# 6 times (48µs+-9µs) by Mouse::Util::meta at line 345 of Mouse/Util.pm, avg 7µs/call
# 5 times (29µs+0s) by Hailo::Engine::Default::meta or Hailo::Storage::SQLite::meta or Hailo::Storage::meta or Hailo::Tokenizer::Words::meta or Hailo::meta at line 136 of Mouse.pm, avg 6µs/call
# 4 times (45µs+86µs) by Mouse::Role::init_meta at line 117 of Mouse/Role.pm, avg 33µs/call
# 3 times (38µs+286µs) by Mouse::Meta::Module::create at line 229, avg 108µs/call
# 3 times (24µs+0s) by Mouse::Util::apply_all_roles at line 276 of Mouse/Util.pm, avg 8µs/call
# 2 times (11µs+0s) by Mouse::override at line 98 of Mouse.pm, avg 6µs/call
# 2 times (11µs+0s) by Mouse::before at line 58 of Mouse.pm, avg 5µs/call
# once (6µs+0s) by Mouse::extends at line 35 of Mouse.pm
# once (6µs+0s) by Mouse::around at line 76 of Mouse.pm
# once (5µs+0s) by Mouse::after at line 67 of Mouse.pm | ||||
24 | 246 | 664µs | my($class, $package_name, @args) = @_; | ||
25 | |||||
26 | ($package_name && !ref($package_name)) | ||||
27 | || $class->throw_error("You must pass a package name and it cannot be blessed"); | ||||
28 | |||||
29 | 14 | 546µs | return $METAS{$package_name} # spent 372µs making 7 calls to Mouse::Meta::Role::_construct_meta, avg 53µs/call
# spent 174µs making 7 calls to Mouse::Meta::Class::_construct_meta, avg 25µs/call | ||
30 | ||= $class->_construct_meta(package => $package_name, @args); | ||||
31 | } | ||||
32 | |||||
33 | sub reinitialize { | ||||
34 | my($class, $package_name, @args) = @_; | ||||
35 | |||||
36 | $package_name = $package_name->name if ref $package_name; | ||||
37 | |||||
38 | ($package_name && !ref($package_name)) | ||||
39 | || $class->throw_error("You must pass a package name and it cannot be blessed"); | ||||
40 | |||||
41 | if(exists $METAS{$package_name}) { | ||||
42 | unshift @args, %{ $METAS{$package_name} }; | ||||
43 | } | ||||
44 | delete $METAS{$package_name}; | ||||
45 | return $class->initialize($package_name, @args); | ||||
46 | } | ||||
47 | |||||
48 | # spent 20µs within Mouse::Meta::Module::_class_of which was called 3 times, avg 7µs/call:
# 3 times (20µs+0s) by Mouse::Util::does_role at line 120 of Mouse/Util.pm, avg 7µs/call | ||||
49 | 9 | 24µs | my($class_or_instance) = @_; | ||
50 | return undef unless defined $class_or_instance; | ||||
51 | return $METAS{ ref($class_or_instance) || $class_or_instance }; | ||||
52 | } | ||||
53 | |||||
54 | # Means of accessing all the metaclasses that have | ||||
55 | # been initialized thus far | ||||
56 | #sub _get_all_metaclasses { %METAS } | ||||
57 | sub _get_all_metaclass_instances { values %METAS } | ||||
58 | sub _get_all_metaclass_names { keys %METAS } | ||||
59 | 60 | 265µs | # spent 203µs within Mouse::Meta::Module::_get_metaclass_by_name which was called 60 times, avg 3µs/call:
# 16 times (56µs+0s) by Mouse::Meta::Class::does_role at line 450 of Mouse/Meta/Class.pm, avg 4µs/call
# 14 times (42µs+0s) by Mouse::Meta::Class::_calculate_all_attributes at line 258 of Mouse/Meta/Class.pm, avg 3µs/call
# 13 times (43µs+0s) by Any::Moose::_backer_of at line 103 of Any/Moose.pm, avg 3µs/call
# 6 times (26µs+0s) by Mouse::Util::apply_all_roles at line 293 of Mouse/Util.pm, avg 4µs/call
# 6 times (20µs+0s) by Mouse::Meta::Class::superclasses at line 59 of Mouse/Meta/Class.pm, avg 3µs/call
# 5 times (16µs+0s) by Mouse::Util::TypeConstraints::_find_or_create_regular_type at line 270 of Mouse/Util/TypeConstraints.pm, avg 3µs/call | ||
60 | #sub _store_metaclass_by_name { $METAS{$_[0]} = $_[1] } | ||||
61 | #sub _weaken_metaclass { weaken($METAS{$_[0]}) } | ||||
62 | #sub _does_metaclass_exist { defined $METAS{$_[0]} } | ||||
63 | #sub _remove_metaclass_by_name { delete $METAS{$_[0]} } | ||||
64 | |||||
65 | sub name; | ||||
66 | |||||
67 | sub namespace; | ||||
68 | |||||
69 | # add_attribute is an abstract method | ||||
70 | |||||
71 | sub get_attribute_map { # DEPRECATED | ||||
72 | Carp::cluck('get_attribute_map() has been deprecated. Use get_attribute_list() and get_attribute() instead'); | ||||
73 | return $_[0]->{attributes}; | ||||
74 | } | ||||
75 | |||||
76 | 10 | 46µs | # spent 35µs within Mouse::Meta::Module::has_attribute which was called 10 times, avg 3µs/call:
# 10 times (35µs+0s) by Mouse::Meta::Role::Application::apply_attributes at line 154 of Mouse/Meta/Role/Application.pm, avg 3µs/call | ||
77 | 20 | 81µs | # spent 61µs within Mouse::Meta::Module::get_attribute which was called 20 times, avg 3µs/call:
# 20 times (61µs+0s) by Mouse::Meta::Role::Application::apply_attributes at line 156 of Mouse/Meta/Role/Application.pm, avg 3µs/call | ||
78 | sub remove_attribute { delete $_[0]->{attributes}->{$_[1]} } | ||||
79 | |||||
80 | 9 | 46µs | # spent 34µs within Mouse::Meta::Module::get_attribute_list which was called 9 times, avg 4µs/call:
# 9 times (34µs+0s) by Mouse::Meta::Role::Application::apply_attributes at line 153 of Mouse/Meta/Role/Application.pm, avg 4µs/call | ||
81 | |||||
82 | # XXX: not completely compatible with Moose | ||||
83 | 1 | 8µs | my %foreign = map{ $_ => undef } qw( | ||
84 | Mouse Mouse::Role Mouse::Util Mouse::Util::TypeConstraints | ||||
85 | Carp Scalar::Util List::Util | ||||
86 | ); | ||||
87 | sub _get_method_body { | ||||
88 | 402 | 1.42ms | my($self, $method_name) = @_; | ||
89 | 134 | 291µs | my $code = Mouse::Util::get_code_ref($self->{package}, $method_name); # spent 291µs making 134 calls to Mouse::Util::get_code_ref, avg 2µs/call | ||
90 | 6 | 12µs | return $code && !exists $foreign{ Mouse::Util::get_code_package($code) } # spent 12µs making 6 calls to Mouse::Util::get_code_package, avg 2µs/call | ||
91 | ? $code | ||||
92 | : undef; | ||||
93 | } | ||||
94 | |||||
95 | sub add_method; | ||||
96 | |||||
97 | # spent 2.46ms (1.17+1.30) within Mouse::Meta::Module::has_method which was called 138 times, avg 18µs/call:
# 123 times (1.02ms+1.12ms) by Mouse::Meta::Module::get_method_list at line 133, avg 17µs/call
# 11 times (103µs+131µs) by Mouse::Meta::Role::add_required_methods at line 49 of Mouse/Meta/Role.pm, avg 21µs/call
# 2 times (23µs+26µs) by Mouse::Meta::Role::Application::apply_methods at line 126 of Mouse/Meta/Role/Application.pm, avg 25µs/call
# 2 times (17µs+20µs) by Mouse::Meta::Class::add_override_method_modifier at line 403 of Mouse/Meta/Class.pm, avg 19µs/call | ||||
98 | 414 | 1.17ms | my($self, $method_name) = @_; | ||
99 | defined($method_name) | ||||
100 | or $self->throw_error('You must define a method name'); | ||||
101 | |||||
102 | 132 | 1.30ms | return defined( $self->{methods}{$method_name} ) # spent 1.30ms making 132 calls to Mouse::Meta::Module::_get_method_body, avg 10µs/call | ||
103 | || defined( $self->_get_method_body($method_name) ); | ||||
104 | } | ||||
105 | |||||
106 | # spent 51µs (23+28) within Mouse::Meta::Module::get_method_body which was called 2 times, avg 25µs/call:
# 2 times (23µs+28µs) by Mouse::Meta::Role::Application::apply_methods at line 124 of Mouse/Meta/Role/Application.pm, avg 25µs/call | ||||
107 | 6 | 22µs | my($self, $method_name) = @_; | ||
108 | defined($method_name) | ||||
109 | or $self->throw_error('You must define a method name'); | ||||
110 | |||||
111 | 2 | 28µs | return $self->{methods}{$method_name} # spent 28µs making 2 calls to Mouse::Meta::Module::_get_method_body, avg 14µs/call | ||
112 | ||= $self->_get_method_body($method_name); | ||||
113 | } | ||||
114 | |||||
115 | sub get_method { | ||||
116 | my($self, $method_name) = @_; | ||||
117 | |||||
118 | if(my $code = $self->get_method_body($method_name)){ | ||||
119 | return Mouse::Util::load_class($self->method_metaclass)->wrap( | ||||
120 | body => $code, | ||||
121 | name => $method_name, | ||||
122 | package => $self->name, | ||||
123 | associated_metaclass => $self, | ||||
124 | ); | ||||
125 | } | ||||
126 | |||||
127 | return undef; | ||||
128 | } | ||||
129 | |||||
130 | # spent 2.87ms (714µs+2.16) within Mouse::Meta::Module::get_method_list which was called 6 times, avg 479µs/call:
# 6 times (714µs+2.16ms) by Mouse::Meta::Role::Application::apply_methods at line 121 of Mouse/Meta/Role/Application.pm, avg 479µs/call | ||||
131 | 135 | 656µs | my($self) = @_; | ||
132 | |||||
133 | 129 | 2.16ms | return grep { $self->has_method($_) } keys %{ $self->namespace }; # spent 2.14ms making 123 calls to Mouse::Meta::Module::has_method, avg 17µs/call
# spent 16µs making 6 calls to Mouse::Meta::Module::namespace, avg 3µs/call | ||
134 | } | ||||
135 | |||||
136 | # spent 52µs within Mouse::Meta::Module::_collect_methods which was called 4 times, avg 13µs/call:
# 2 times (24µs+0s) by Mouse::before at line 60 of Mouse.pm, avg 12µs/call
# once (15µs+0s) by Mouse::around at line 78 of Mouse.pm
# once (13µs+0s) by Mouse::after at line 69 of Mouse.pm | ||||
137 | 24 | 57µs | my($meta, @args) = @_; | ||
138 | |||||
139 | my @methods; | ||||
140 | foreach my $arg(@args){ | ||||
141 | if(my $type = ref $arg){ | ||||
142 | if($type eq 'Regexp'){ | ||||
143 | push @methods, grep { $_ =~ $arg } $meta->get_all_method_names; | ||||
144 | } | ||||
145 | elsif($type eq 'ARRAY'){ | ||||
146 | push @methods, @{$arg}; | ||||
147 | } | ||||
148 | else{ | ||||
149 | my $subname = ( caller(1) )[3]; | ||||
150 | $meta->throw_error( | ||||
151 | sprintf( | ||||
152 | 'Methods passed to %s must be provided as a list,' | ||||
153 | . ' ArrayRef or regular expression, not %s', | ||||
154 | $subname, | ||||
155 | $type, | ||||
156 | ) | ||||
157 | ); | ||||
158 | } | ||||
159 | } | ||||
160 | else{ | ||||
161 | push @methods, $arg; | ||||
162 | } | ||||
163 | } | ||||
164 | return @methods; | ||||
165 | } | ||||
166 | |||||
167 | 1 | 1µs | my $ANON_SERIAL = 0; # anonymous class/role id | ||
168 | 1 | 1µs | my %IMMORTALS; # immortal anonymous classes | ||
169 | |||||
170 | # spent 627µs (199+428) within Mouse::Meta::Module::create which was called 3 times, avg 209µs/call:
# 3 times (199µs+428µs) by Mouse::Meta::Role::create_anon_role at line 28 of Mouse/Meta/Role.pm, avg 209µs/call | ||||
171 | 90 | 204µs | my($self, $package_name, %options) = @_; | ||
172 | |||||
173 | my $class = ref($self) || $self; | ||||
174 | $self->throw_error('You must pass a package name') if @_ < 2; | ||||
175 | |||||
176 | my $superclasses; | ||||
177 | if(exists $options{superclasses}){ | ||||
178 | if(Mouse::Util::is_a_metarole($self)){ | ||||
179 | delete $options{superclasses}; | ||||
180 | } | ||||
181 | else{ | ||||
182 | $superclasses = delete $options{superclasses}; | ||||
183 | (ref $superclasses eq 'ARRAY') | ||||
184 | || $self->throw_error("You must pass an ARRAY ref of superclasses"); | ||||
185 | } | ||||
186 | } | ||||
187 | |||||
188 | my $attributes = delete $options{attributes}; | ||||
189 | if(defined $attributes){ | ||||
190 | (ref $attributes eq 'ARRAY' || ref $attributes eq 'HASH') | ||||
191 | || $self->throw_error("You must pass an ARRAY ref of attributes"); | ||||
192 | } | ||||
193 | my $methods = delete $options{methods}; | ||||
194 | if(defined $methods){ | ||||
195 | (ref $methods eq 'HASH') | ||||
196 | || $self->throw_error("You must pass a HASH ref of methods"); | ||||
197 | } | ||||
198 | my $roles = delete $options{roles}; | ||||
199 | if(defined $roles){ | ||||
200 | (ref $roles eq 'ARRAY') | ||||
201 | || $self->throw_error("You must pass an ARRAY ref of roles"); | ||||
202 | } | ||||
203 | my $mortal; | ||||
204 | my $cache_key; | ||||
205 | |||||
206 | if(!defined $package_name){ # anonymous | ||||
207 | $mortal = !$options{cache}; | ||||
208 | |||||
209 | # anonymous but immortal | ||||
210 | if(!$mortal){ | ||||
211 | # something like Super::Class|Super::Class::2=Role|Role::1 | ||||
212 | $cache_key = join '=' => ( | ||||
213 | join('|', @{$superclasses || []}), | ||||
214 | join('|', sort @{$roles || []}), | ||||
215 | ); | ||||
216 | return $IMMORTALS{$cache_key} if exists $IMMORTALS{$cache_key}; | ||||
217 | } | ||||
218 | $options{anon_serial_id} = ++$ANON_SERIAL; | ||||
219 | $package_name = $class . '::__ANON__::' . $ANON_SERIAL; | ||||
220 | } | ||||
221 | |||||
222 | # instantiate a module | ||||
223 | { | ||||
224 | 2 | 321µs | 2 | 56µs | # spent 33µs (11+23) within Mouse::Meta::Module::BEGIN@224 which was called:
# once (11µs+23µs) by Mouse::BEGIN@4 at line 224 # spent 33µs making 1 call to Mouse::Meta::Module::BEGIN@224
# spent 22µs making 1 call to strict::unimport |
225 | ${ $package_name . '::VERSION' } = delete $options{version} if exists $options{version}; | ||||
226 | ${ $package_name . '::AUTHORITY' } = delete $options{authority} if exists $options{authority}; | ||||
227 | } | ||||
228 | |||||
229 | 3 | 324µs | my $meta = $self->initialize( $package_name, %options); # spent 324µs making 3 calls to Mouse::Meta::Module::initialize, avg 108µs/call | ||
230 | |||||
231 | 3 | 7µs | Scalar::Util::weaken($METAS{$package_name}) # spent 7µs making 3 calls to Scalar::Util::weaken, avg 2µs/call | ||
232 | if $mortal; | ||||
233 | |||||
234 | $meta->add_method(meta => sub { | ||||
235 | $self->initialize(ref($_[0]) || $_[0]); | ||||
236 | 3 | 96µs | }); # spent 96µs making 3 calls to Mouse::Meta::Role::Composite::add_method, avg 32µs/call | ||
237 | |||||
238 | $meta->superclasses(@{$superclasses}) | ||||
239 | if defined $superclasses; | ||||
240 | |||||
241 | # NOTE: | ||||
242 | # process attributes first, so that they can | ||||
243 | # install accessors, but locally defined methods | ||||
244 | # can then overwrite them. It is maybe a little odd, but | ||||
245 | # I think this should be the order of things. | ||||
246 | if (defined $attributes) { | ||||
247 | if(ref($attributes) eq 'ARRAY'){ | ||||
248 | # array of Mouse::Meta::Attribute | ||||
249 | foreach my $attr (@{$attributes}) { | ||||
250 | $meta->add_attribute($attr); | ||||
251 | } | ||||
252 | } | ||||
253 | else{ | ||||
254 | # hash map of name and attribute spec pairs | ||||
255 | while(my($name, $attr) = each %{$attributes}){ | ||||
256 | $meta->add_attribute($name => $attr); | ||||
257 | } | ||||
258 | } | ||||
259 | } | ||||
260 | if (defined $methods) { | ||||
261 | while(my($method_name, $method_body) = each %{$methods}){ | ||||
262 | $meta->add_method($method_name, $method_body); | ||||
263 | } | ||||
264 | } | ||||
265 | if (defined $roles){ | ||||
266 | Mouse::Util::apply_all_roles($package_name, @{$roles}); | ||||
267 | } | ||||
268 | |||||
269 | if($cache_key){ | ||||
270 | $IMMORTALS{$cache_key} = $meta; | ||||
271 | } | ||||
272 | |||||
273 | return $meta; | ||||
274 | } | ||||
275 | |||||
276 | sub DESTROY{ | ||||
277 | my($self) = @_; | ||||
278 | |||||
279 | return if $Mouse::Util::in_global_destruction; | ||||
280 | |||||
281 | my $serial_id = $self->{anon_serial_id}; | ||||
282 | return if !$serial_id; | ||||
283 | |||||
284 | # XXX: cleaning stash with threads causes panic/SEGV on legacy perls. | ||||
285 | if(exists $INC{'threads.pm'}) { | ||||
286 | # (caller)[2] indicates the caller's line number, | ||||
287 | # which is zero when the current thread is joining (destroying). | ||||
288 | return if( (caller)[2] == 0); | ||||
289 | } | ||||
290 | |||||
291 | # clean up mortal anonymous class stuff | ||||
292 | |||||
293 | # @ISA is a magical variable, so we must clear it manually. | ||||
294 | @{$self->{superclasses}} = () if exists $self->{superclasses}; | ||||
295 | |||||
296 | # Then, clear the symbol table hash | ||||
297 | %{$self->namespace} = (); | ||||
298 | |||||
299 | my $name = $self->name; | ||||
300 | delete $METAS{$name}; | ||||
301 | |||||
302 | $name =~ s/ $serial_id \z//xms; | ||||
303 | 2 | 49µs | 2 | 58µs | # spent 36µs (14+22) within Mouse::Meta::Module::BEGIN@303 which was called:
# once (14µs+22µs) by Mouse::BEGIN@4 at line 303 # spent 36µs making 1 call to Mouse::Meta::Module::BEGIN@303
# spent 22µs making 1 call to strict::unimport |
304 | delete ${$name}{ $serial_id . '::' }; | ||||
305 | return; | ||||
306 | } | ||||
307 | |||||
308 | |||||
309 | 1 | 6µs | 1; | ||
310 | __END__ | ||||
# spent 579µs within Mouse::Meta::Module::add_method which was called 87 times, avg 7µs/call:
# 54 times (331µs+0s) by Mouse::Meta::Attribute::install_accessors at line 258 of Mouse/Meta/Attribute.pm, avg 6µs/call
# 9 times (78µs+0s) by Mouse::init_meta at line 137 of Mouse.pm, avg 9µs/call
# 5 times (27µs+0s) by Mouse::Meta::Class::make_immutable at line 290 of Mouse/Meta/Class.pm, avg 5µs/call
# 5 times (23µs+0s) by Mouse::Meta::Class::make_immutable at line 296 of Mouse/Meta/Class.pm, avg 5µs/call
# 4 times (41µs+0s) by Mouse::Role::init_meta at line 121 of Mouse/Role.pm, avg 10µs/call
# 4 times (25µs+0s) by Mouse::Meta::Class::_install_modifier at line 366 of Mouse/Meta/Class.pm, avg 6µs/call
# 3 times (36µs+0s) by Mouse::Meta::Role::Composite::add_method at line 39 of Mouse/Meta/Role/Composite.pm, avg 12µs/call
# 2 times (13µs+0s) by Mouse::Meta::Class::add_override_method_modifier at line 417 of Mouse/Meta/Class.pm, avg 6µs/call
# once (5µs+0s) by Mouse::Meta::Role::Application::apply_methods at line 126 of Mouse/Meta/Role/Application.pm | |||||
# spent 77µs within Mouse::Meta::Module::name which was called 57 times, avg 1µs/call:
# 33 times (42µs+0s) by Mouse::Meta::Role::does_role at line 117 of Mouse/Meta/Role.pm, avg 1µs/call
# 9 times (12µs+0s) by Mouse::Meta::Class::does_role at line 447 of Mouse/Meta/Class.pm, avg 1µs/call
# 6 times (9µs+0s) by Mouse::Meta::Role::does_role at line 114 of Mouse/Meta/Role.pm, avg 1µs/call
# 4 times (6µs+0s) by Mouse::Meta::Class::_install_modifier at line 318 of Mouse/Meta/Class.pm, avg 1µs/call
# 3 times (5µs+0s) by Mouse::Meta::Role::Application::check_required_methods at line 93 of Mouse/Meta/Role/Application.pm, avg 2µs/call
# 2 times (3µs+0s) by Mouse::Meta::Class::add_override_method_modifier at line 407 of Mouse/Meta/Class.pm, avg 2µs/call | |||||
# spent 16µs within Mouse::Meta::Module::namespace which was called 6 times, avg 3µs/call:
# 6 times (16µs+0s) by Mouse::Meta::Module::get_method_list at line 133, avg 3µs/call |