← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/hailo
  Run on Thu Oct 21 22:50:37 2010
Reported on Thu Oct 21 22:52:04 2010

Filename/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/x86_64-linux/Mouse/Meta/Module.pm
StatementsExecuted 4184 statements in 13.6ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
298442.38ms4.90msMouse::Meta::Module::::has_method Mouse::Meta::Module::has_method
260212.13ms2.73msMouse::Meta::Module::::_get_method_body Mouse::Meta::Module::_get_method_body
14111.34ms4.97msMouse::Meta::Module::::get_method_list Mouse::Meta::Module::get_method_list
1941741.29ms2.03msMouse::Meta::Module::::initialize Mouse::Meta::Module::initialize (recurses: max depth 1, inclusive time 47µs)
1991071.28ms1.28msMouse::Meta::Module::::add_method Mouse::Meta::Module::add_method (xsub)
29221.18ms3.41msMouse::Meta::Module::::create Mouse::Meta::Module::create
13911740µs740µsMouse::Meta::Module::::_class_of Mouse::Meta::Module::_class_of
22364661µs661µsMouse::Meta::Module::::_get_metaclass_by_name Mouse::Meta::Module::_get_metaclass_by_name
5611366µs578µsMouse::Meta::Module::::get_method_body Mouse::Meta::Module::get_method_body
19874276µs276µsMouse::Meta::Module::::name Mouse::Meta::Module::name (xsub)
3621243µs438µsMouse::Meta::Class::__ANON__::2::::meta Mouse::Meta::Class::__ANON__::2::meta
942122µs122µsMouse::Meta::Module::::_collect_methods Mouse::Meta::Module::_collect_methods
3811115µs115µsMouse::Meta::Module::::get_attribute Mouse::Meta::Module::get_attribute
281195µs95µsMouse::Meta::Module::::has_attribute Mouse::Meta::Module::has_attribute
182269µs69µsMouse::Meta::Module::::get_attribute_list Mouse::Meta::Module::get_attribute_list
81156µs101µsMouse::Meta::Class::__ANON__::1::::meta Mouse::Meta::Class::__ANON__::1::meta
342253µs53µsMouse::Meta::Class::__ANON__::2::::has_cmd_flag Mouse::Meta::Class::__ANON__::2::has_cmd_flag (xsub)
261141µs41µsMouse::Meta::Module::::CORE:sort Mouse::Meta::Module::CORE:sort (opcode)
141137µs37µsMouse::Meta::Module::::namespace Mouse::Meta::Module::namespace (xsub)
11127µs124µsMouse::Meta::Module::::BEGIN@2 Mouse::Meta::Module::BEGIN@2
171126µs26µsMouse::Meta::Class::__ANON__::2::::has_cmd_aliases Mouse::Meta::Class::__ANON__::2::has_cmd_aliases (xsub)
171124µs24µsMouse::Meta::Class::__ANON__::2::::cmd_flag Mouse::Meta::Class::__ANON__::2::cmd_flag (xsub)
161122µs22µsMouse::Meta::Class::__ANON__::2::::cmd_aliases Mouse::Meta::Class::__ANON__::2::cmd_aliases (xsub)
11112µs37µsMouse::Meta::Module::::BEGIN@224 Mouse::Meta::Module::BEGIN@224
11111µs33µsMouse::Meta::Module::::BEGIN@303 Mouse::Meta::Module::BEGIN@303
1116µs6µsMouse::Meta::Module::::BEGIN@4 Mouse::Meta::Module::BEGIN@4
1116µs6µsMouse::Meta::Module::::BEGIN@5 Mouse::Meta::Module::BEGIN@5
0000s0sMouse::Meta::Module::::DESTROY Mouse::Meta::Module::DESTROY
0000s0sMouse::Meta::Module::::__ANON__[:14] Mouse::Meta::Module::__ANON__[:14]
0000s0sMouse::Meta::Module::::__ANON__[:236] Mouse::Meta::Module::__ANON__[:236]
0000s0sMouse::Meta::Module::::_get_all_metaclass_instances Mouse::Meta::Module::_get_all_metaclass_instances
0000s0sMouse::Meta::Module::::_get_all_metaclass_names Mouse::Meta::Module::_get_all_metaclass_names
0000s0sMouse::Meta::Module::::_metaclass_cache Mouse::Meta::Module::_metaclass_cache
0000s0sMouse::Meta::Module::::get_attribute_map Mouse::Meta::Module::get_attribute_map
0000s0sMouse::Meta::Module::::get_method Mouse::Meta::Module::get_method
0000s0sMouse::Meta::Module::::reinitialize Mouse::Meta::Module::reinitialize
0000s0sMouse::Meta::Module::::remove_attribute Mouse::Meta::Module::remove_attribute
0000s0sMouse::Meta::Role::Composite::__ANON__::3::::metaMouse::Meta::Role::Composite::__ANON__::3::meta
0000s0sMouse::Meta::Role::Composite::__ANON__::4::::metaMouse::Meta::Role::Composite::__ANON__::4::meta
0000s0sMouse::Meta::Role::Composite::__ANON__::5::::metaMouse::Meta::Role::Composite::__ANON__::5::meta
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Mouse::Meta::Module;
2230µs2222µs
# spent 124µs (27+98) within Mouse::Meta::Module::BEGIN@2 which was called: # once (27µs+98µs) by Mouse::BEGIN@4 at line 2
use Mouse::Util qw/:meta/; # enables strict and warnings
# spent 124µs making 1 call to Mouse::Meta::Module::BEGIN@2 # spent 98µs making 1 call to Mouse::Exporter::do_import
3
4222µs16µs
# spent 6µs within Mouse::Meta::Module::BEGIN@4 which was called: # once (6µs+0s) by Mouse::BEGIN@4 at line 4
use Carp ();
# spent 6µs making 1 call to Mouse::Meta::Module::BEGIN@4
52915µs16µs
# spent 6µs within Mouse::Meta::Module::BEGIN@5 which was called: # once (6µs+0s) by Mouse::BEGIN@4 at line 5
use Scalar::Util ();
# spent 6µs making 1 call to Mouse::Meta::Module::BEGIN@5
6
711µsmy %METAS;
8
912µsif(Mouse::Util::MOUSE_XS){
10 # register meta storage for performance
1118µs12µ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
1413µs *CLONE = sub { Mouse::Util::__register_metaclass_storage(\%METAS, 1) };
15}
16
17sub _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 2.03ms (1.29+747µs) within Mouse::Meta::Module::initialize which was called 194 times, avg 10µs/call: # 50 times (290µs+0s) by Mouse::has at line 45 of Mouse.pm, avg 6µs/call # 44 times (240µs+0s) by Mouse::Meta::Class::__ANON__::1::meta or Mouse::Meta::Class::__ANON__::2::meta at line 235, avg 5µs/call # 15 times (153µs+237µs) by Mouse::init_meta at line 133 of Mouse.pm, avg 26µs/call # 14 times (81µs+0s) by Mouse::Role::has at line 37 of Mouse/Role.pm, avg 6µs/call # 11 times (72µs+0s) by Mouse::Util::apply_all_roles at line 276 of Mouse/Util.pm, avg 7µs/call # 11 times (66µs+0s) by Hailo::Command::meta or Hailo::Engine::Default::meta or Hailo::Storage::SQLite::meta or Hailo::Storage::meta or Hailo::Tokenizer::Words::meta or Hailo::meta or MouseX::Getopt::Meta::Attribute::NoGetopt::meta or hailo::meta at line 136 of Mouse.pm, avg 6µs/call # 11 times (59µs+0s) by Mouse::Role::requires at line 98 of Mouse/Role.pm, avg 5µs/call # 10 times (118µs+207µs) by Mouse::Role::init_meta at line 117 of Mouse/Role.pm, avg 32µ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 (58µs+313µs) by Mouse::Meta::Module::create at line 229, avg 74µs/call # 4 times (28µs+0s) by Mouse::extends at line 35 of Mouse.pm, avg 7µs/call # 4 times (23µs+0s) by Mouse::before at line 58 of Mouse.pm, avg 6µs/call # 3 times (17µs+0s) by Mouse::Role::around at line 68 of Mouse/Role.pm, avg 6µs/call # 3 times (16µs+0s) by Mouse::override at line 98 of Mouse.pm, avg 5µs/call # once (6µs+0s) by Mouse::around at line 76 of Mouse.pm # once (6µs+0s) by MouseX::Getopt::GLD::meta at line 120 of Mouse/Role.pm # once (5µs+0s) by Mouse::after at line 67 of Mouse.pm
sub initialize {
245821.49ms 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
2927794µs return $METAS{$package_name}
# spent 474µs making 13 calls to Mouse::Meta::Role::_construct_meta, avg 36µs/call # spent 320µs making 14 calls to Mouse::Meta::Class::_construct_meta, avg 23µs/call
30 ||= $class->_construct_meta(package => $package_name, @args);
31}
32
33sub 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 740µs within Mouse::Meta::Module::_class_of which was called 139 times, avg 5µs/call: # 139 times (740µs+0s) by Mouse::Util::does_role at line 120 of Mouse/Util.pm, avg 5µs/call
sub _class_of{
49417852µ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 }
57sub _get_all_metaclass_instances { values %METAS }
58sub _get_all_metaclass_names { keys %METAS }
59223845µs
# spent 661µs within Mouse::Meta::Module::_get_metaclass_by_name which was called 223 times, avg 3µs/call: # 126 times (355µs+0s) by Mouse::Meta::Class::does_role at line 450 of Mouse/Meta/Class.pm, avg 3µs/call # 42 times (125µs+0s) by Mouse::Meta::Class::_calculate_all_attributes at line 258 of Mouse/Meta/Class.pm, avg 3µs/call # 19 times (64µs+0s) by Any::Moose::_backer_of at line 103 of Any/Moose.pm, avg 3µs/call # 16 times (50µs+0s) by Mouse::Meta::Class::superclasses at line 59 of Mouse/Meta/Class.pm, avg 3µs/call # 14 times (48µs+0s) by Mouse::Util::apply_all_roles at line 293 of Mouse/Util.pm, avg 3µs/call # 6 times (20µs+0s) by Mouse::Util::TypeConstraints::_find_or_create_regular_type at line 270 of Mouse/Util/TypeConstraints.pm, avg 3µs/call
sub _get_metaclass_by_name { $METAS{$_[0]} }
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
65sub name;
66
67sub namespace;
68
69# add_attribute is an abstract method
70
71sub 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
7628124µs
# spent 95µs within Mouse::Meta::Module::has_attribute which was called 28 times, avg 3µs/call: # 28 times (95µs+0s) by Mouse::Meta::Role::Application::apply_attributes at line 154 of Mouse/Meta/Role/Application.pm, avg 3µs/call
sub has_attribute { exists $_[0]->{attributes}->{$_[1]} }
7738153µs
# spent 115µs within Mouse::Meta::Module::get_attribute which was called 38 times, avg 3µs/call: # 38 times (115µs+0s) by Mouse::Meta::Role::Application::apply_attributes at line 156 of Mouse/Meta/Role/Application.pm, avg 3µs/call
sub get_attribute { $_[0]->{attributes}->{$_[1]} }
78sub remove_attribute { delete $_[0]->{attributes}->{$_[1]} }
79
801890µs
# spent 69µs within Mouse::Meta::Module::get_attribute_list which was called 18 times, avg 4µs/call: # 17 times (65µs+0s) by Mouse::Meta::Role::Application::apply_attributes at line 153 of Mouse/Meta/Role/Application.pm, avg 4µs/call # once (4µs+0s) by hailo::BEGIN@8 at line 18 of lib/Hailo/Command.pm
sub get_attribute_list{ keys %{$_[0]->{attributes}} }
81
82# XXX: not completely compatible with Moose
8319µsmy %foreign = map{ $_ => undef } qw(
84 Mouse Mouse::Role Mouse::Util Mouse::Util::TypeConstraints
85 Carp Scalar::Util List::Util
86);
87
# spent 2.73ms (2.13+607µs) within Mouse::Meta::Module::_get_method_body which was called 260 times, avg 11µs/call: # 244 times (1.97ms+551µs) by Mouse::Meta::Module::has_method at line 102, avg 10µs/call # 16 times (156µs+56µs) by Mouse::Meta::Module::get_method_body at line 111, avg 13µs/call
sub _get_method_body {
887802.91ms my($self, $method_name) = @_;
89260524µs my $code = Mouse::Util::get_code_ref($self->{package}, $method_name);
# spent 524µs making 260 calls to Mouse::Util::get_code_ref, avg 2µs/call
905283µs return $code && !exists $foreign{ Mouse::Util::get_code_package($code) }
# spent 83µs making 52 calls to Mouse::Util::get_code_package, avg 2µs/call
91 ? $code
92 : undef;
93}
94
95sub add_method;
96
97
# spent 4.90ms (2.38+2.52) within Mouse::Meta::Module::has_method which was called 298 times, avg 16µs/call: # 228 times (1.78ms+1.82ms) by Mouse::Meta::Module::get_method_list at line 133, avg 16µs/call # 56 times (474µs+550µs) by Mouse::Meta::Role::Application::apply_methods at line 126 of Mouse/Meta/Role/Application.pm, avg 18µs/call # 11 times (102µs+121µs) by Mouse::Meta::Role::add_required_methods at line 49 of Mouse/Meta/Role.pm, avg 20µs/call # 3 times (26µs+31µs) by Mouse::Meta::Class::add_override_method_modifier at line 403 of Mouse/Meta/Class.pm, avg 19µs/call
sub has_method {
988942.43ms my($self, $method_name) = @_;
99 defined($method_name)
100 or $self->throw_error('You must define a method name');
101
1022442.52ms return defined( $self->{methods}{$method_name} )
# spent 2.52ms making 244 calls to Mouse::Meta::Module::_get_method_body, avg 10µs/call
103 || defined( $self->_get_method_body($method_name) );
104}
105
106
# spent 578µs (366+212) within Mouse::Meta::Module::get_method_body which was called 56 times, avg 10µs/call: # 56 times (366µs+212µs) by Mouse::Meta::Role::Application::apply_methods at line 124 of Mouse/Meta/Role/Application.pm, avg 10µs/call
sub get_method_body {
107168401µs my($self, $method_name) = @_;
108 defined($method_name)
109 or $self->throw_error('You must define a method name');
110
11116212µs return $self->{methods}{$method_name}
# spent 212µs making 16 calls to Mouse::Meta::Module::_get_method_body, avg 13µs/call
112 ||= $self->_get_method_body($method_name);
113}
114
115sub 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 4.97ms (1.34+3.64) within Mouse::Meta::Module::get_method_list which was called 14 times, avg 355µs/call: # 14 times (1.34ms+3.64ms) by Mouse::Meta::Role::Application::apply_methods at line 121 of Mouse/Meta/Role/Application.pm, avg 355µs/call
sub get_method_list {
1312561.23ms my($self) = @_;
132
1332423.64ms return grep { $self->has_method($_) } keys %{ $self->namespace };
# spent 3.60ms making 228 calls to Mouse::Meta::Module::has_method, avg 16µs/call # spent 37µs making 14 calls to Mouse::Meta::Module::namespace, avg 3µs/call
134}
135
136
# spent 122µs within Mouse::Meta::Module::_collect_methods which was called 9 times, avg 14µs/call: # 4 times (53µs+0s) by Mouse::before at line 60 of Mouse.pm, avg 13µs/call # 3 times (42µs+0s) by Mouse::Role::around at line 70 of Mouse/Role.pm, avg 14µs/call # once (14µs+0s) by Mouse::around at line 78 of Mouse.pm # once (13µs+0s) by Mouse::after at line 69 of Mouse.pm
sub _collect_methods { # Mouse specific
13754131µ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
16711µsmy $ANON_SERIAL = 0; # anonymous class/role id
1681700nsmy %IMMORTALS; # immortal anonymous classes
169
170
# spent 3.41ms (1.18+2.23) within Mouse::Meta::Module::create which was called 29 times, avg 118µs/call: # 26 times (987µs+1.83ms) by Mouse::Meta::Class::create_anon_class at line 39 of Mouse/Meta/Class.pm, avg 108µs/call # 3 times (190µs+404µs) by Mouse::Meta::Role::create_anon_role at line 28 of Mouse/Meta/Role.pm, avg 198µs/call
sub create {
1716641.29ms 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}){
1782639µs if(Mouse::Util::is_a_metarole($self)){
# spent 39µs making 26 calls to Mouse::Util::is_a_metarole, avg 1µs/call
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 || []}),
2142641µs join('|', sort @{$roles || []}),
# spent 41µs making 26 calls to Mouse::Meta::Module::CORE:sort, avg 2µs/call
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 {
2242318µs262µs
# spent 37µs (12+25) within Mouse::Meta::Module::BEGIN@224 which was called: # once (12µs+25µs) by Mouse::BEGIN@4 at line 224
no strict 'refs';
# spent 37µs making 1 call to Mouse::Meta::Module::BEGIN@224 # spent 25µ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
2295371µs my $meta = $self->initialize( $package_name, %options);
# spent 371µs making 5 calls to Mouse::Meta::Module::initialize, avg 74µs/call
230
23137µ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
# spent 101µs (56+45) within Mouse::Meta::Class::__ANON__::1::meta which was called 8 times, avg 13µs/call: # 8 times (56µs+45µs) by Mouse::Meta::Attribute::new at line 83 of Mouse/Meta/Attribute.pm, avg 13µs/call # spent 438µs (243+195) within Mouse::Meta::Class::__ANON__::2::meta which was called 36 times, avg 12µs/call: # 18 times (124µs+99µs) by Mouse::Meta::Attribute::new at line 69 of Mouse/Meta/Attribute.pm, avg 12µs/call # 18 times (120µs+96µs) by Mouse::Meta::Attribute::new at line 83 of Mouse/Meta/Attribute.pm, avg 12µs/call
$meta->add_method(meta => sub {
23544263µs44240µs $self->initialize(ref($_[0]) || $_[0]);
# spent 240µs making 44 calls to Mouse::Meta::Module::initialize, avg 5µs/call
2365115µs });
# spent 95µs making 3 calls to Mouse::Meta::Role::Composite::add_method, avg 32µs/call # spent 20µs making 2 calls to Mouse::Meta::Module::add_method, avg 10µs/call
237
2382133µs $meta->superclasses(@{$superclasses})
# spent 133µs making 2 calls to Mouse::Meta::Class::superclasses, avg 67µs/call
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 }
26520s if (defined $roles){
# spent 1.53ms making 2 calls to Mouse::Util::apply_all_roles, avg 763µs/call, recursion: max depth 1, sum of overlapping time 1.53ms
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
276sub 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;
303252µs255µs
# spent 33µs (11+22) within Mouse::Meta::Module::BEGIN@303 which was called: # once (11µs+22µs) by Mouse::BEGIN@4 at line 303
no strict 'refs';
# spent 33µ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
30916µs1;
310__END__
 
# spent 22µs within Mouse::Meta::Class::__ANON__::2::cmd_aliases which was called 16 times, avg 1µs/call: # 16 times (22µs+0s) by MouseX::Getopt::Basic::_get_cmd_flags_for_attr at line 187 of MouseX/Getopt/Basic.pm, avg 1µs/call
sub Mouse::Meta::Class::__ANON__::2::cmd_aliases; # xsub
# spent 24µs within Mouse::Meta::Class::__ANON__::2::cmd_flag which was called 17 times, avg 1µs/call: # 17 times (24µs+0s) by MouseX::Getopt::Basic::_get_cmd_flags_for_attr at line 186 of MouseX/Getopt/Basic.pm, avg 1µs/call
sub Mouse::Meta::Class::__ANON__::2::cmd_flag; # xsub
# spent 26µs within Mouse::Meta::Class::__ANON__::2::has_cmd_aliases which was called 17 times, avg 2µs/call: # 17 times (26µs+0s) by MouseX::Getopt::Basic::_get_cmd_flags_for_attr at line 187 of MouseX/Getopt/Basic.pm, avg 2µs/call
sub Mouse::Meta::Class::__ANON__::2::has_cmd_aliases; # xsub
# spent 53µs within Mouse::Meta::Class::__ANON__::2::has_cmd_flag which was called 34 times, avg 2µs/call: # 17 times (27µs+0s) by MouseX::Getopt::Basic::_get_cmd_flags_for_attr at line 186 of MouseX/Getopt/Basic.pm, avg 2µs/call # 17 times (26µs+0s) by MouseX::Getopt::Dashes::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/MouseX/Getopt/Dashes.pm:24] at line 19 of MouseX/Getopt/Dashes.pm, avg 2µs/call
sub Mouse::Meta::Class::__ANON__::2::has_cmd_flag; # xsub
# spent 41µs within Mouse::Meta::Module::CORE:sort which was called 26 times, avg 2µs/call: # 26 times (41µs+0s) by Mouse::Meta::Module::create at line 214, avg 2µs/call
sub Mouse::Meta::Module::CORE:sort; # opcode
# spent 1.28ms within Mouse::Meta::Module::add_method which was called 199 times, avg 6µs/call: # 90 times (595µs+0s) by Mouse::Meta::Attribute::install_accessors at line 258 of Mouse/Meta/Attribute.pm, avg 7µs/call # 53 times (261µs+0s) by Mouse::Meta::Role::Application::apply_methods at line 126 of Mouse/Meta/Role/Application.pm, avg 5µs/call # 15 times (123µs+0s) by Mouse::init_meta at line 137 of Mouse.pm, avg 8µs/call # 10 times (92µs+0s) by Mouse::Role::init_meta at line 121 of Mouse/Role.pm, avg 9µs/call # 9 times (58µs+0s) by Mouse::Meta::Class::_install_modifier at line 366 of Mouse/Meta/Class.pm, avg 6µs/call # 7 times (42µs+0s) by Mouse::Meta::Class::make_immutable at line 290 of Mouse/Meta/Class.pm, avg 6µs/call # 7 times (31µs+0s) by Mouse::Meta::Class::make_immutable at line 296 of Mouse/Meta/Class.pm, avg 4µs/call # 3 times (34µs+0s) by Mouse::Meta::Role::Composite::add_method at line 39 of Mouse/Meta/Role/Composite.pm, avg 11µs/call # 3 times (22µs+0s) by Mouse::Meta::Class::add_override_method_modifier at line 417 of Mouse/Meta/Class.pm, avg 7µs/call # 2 times (20µs+0s) by Mouse::Meta::Module::create at line 236, avg 10µs/call
sub Mouse::Meta::Module::add_method; # xsub
# spent 276µs within Mouse::Meta::Module::name which was called 198 times, avg 1µs/call: # 126 times (166µs+0s) by Mouse::Meta::Role::does_role at line 117 of Mouse/Meta/Role.pm, avg 1µs/call # 26 times (43µs+0s) by Mouse::Meta::Attribute::interpolate_class at line 129 of Mouse/Meta/Attribute.pm, avg 2µs/call # 15 times (21µs+0s) by Mouse::Meta::Class::does_role at line 447 of Mouse/Meta/Class.pm, avg 1µs/call # 11 times (16µs+0s) by Mouse::Meta::Role::does_role at line 114 of Mouse/Meta/Role.pm, avg 1µs/call # 9 times (12µs+0s) by Mouse::Meta::Class::_install_modifier at line 318 of Mouse/Meta/Class.pm, avg 1µs/call # 8 times (12µs+0s) by Mouse::Meta::Role::Application::check_required_methods at line 93 of Mouse/Meta/Role/Application.pm, avg 2µs/call # 3 times (5µs+0s) by Mouse::Meta::Class::add_override_method_modifier at line 407 of Mouse/Meta/Class.pm, avg 2µs/call
sub Mouse::Meta::Module::name; # xsub
# spent 37µs within Mouse::Meta::Module::namespace which was called 14 times, avg 3µs/call: # 14 times (37µs+0s) by Mouse::Meta::Module::get_method_list at line 133, avg 3µs/call
sub Mouse::Meta::Module::namespace; # xsub