← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:06 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Class/MOP/Mixin/HasMethods.pm
StatementsExecuted 12523 statements in 31.2ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
40121817.6ms27.6msClass::MOP::Mixin::HasMethods::::add_methodClass::MOP::Mixin::HasMethods::add_method
585744.28ms15.8msClass::MOP::Mixin::HasMethods::::get_methodClass::MOP::Mixin::HasMethods::get_method
629212.11ms10.4msClass::MOP::Mixin::HasMethods::::_get_maybe_raw_methodClass::MOP::Mixin::HasMethods::_get_maybe_raw_method
401111.10ms1.39msClass::MOP::Mixin::HasMethods::::update_package_cache_flagClass::MOP::Mixin::HasMethods::update_package_cache_flag
6711434µs1.34msClass::MOP::Mixin::HasMethods::::wrap_method_bodyClass::MOP::Mixin::HasMethods::wrap_method_body
40111399µs399µsClass::MOP::Mixin::HasMethods::::CORE:matchClass::MOP::Mixin::HasMethods::CORE:match (opcode)
2554327µs12.4msClass::MOP::Mixin::HasMethods::::_add_meta_methodClass::MOP::Mixin::HasMethods::_add_meta_method
111322µs1.52msClass::MOP::Mixin::HasMethods::::BEGIN@7Class::MOP::Mixin::HasMethods::BEGIN@7
10611315µs398µsClass::MOP::Mixin::HasMethods::::_code_is_mineClass::MOP::Mixin::HasMethods::_code_is_mine
111172µs359µsClass::MOP::Mixin::HasMethods::::BEGIN@10Class::MOP::Mixin::HasMethods::BEGIN@10
1511142µs4.75msClass::MOP::Mixin::HasMethods::::_full_method_mapClass::MOP::Mixin::HasMethods::_full_method_map
4442113µs596µsClass::MOP::Mixin::HasMethods::::has_methodClass::MOP::Mixin::HasMethods::has_method
151149µs4.79msClass::MOP::Mixin::HasMethods::::_get_local_methodsClass::MOP::Mixin::HasMethods::_get_local_methods
252126µs26µsClass::MOP::Mixin::HasMethods::::_meta_method_classClass::MOP::Mixin::HasMethods::_meta_method_class
1118µs10µsClass::MOP::Mixin::HasMethods::::BEGIN@4Class::MOP::Mixin::HasMethods::BEGIN@4
1116µs35µsClass::MOP::Mixin::HasMethods::::BEGIN@9Class::MOP::Mixin::HasMethods::BEGIN@9
1115µs21µsClass::MOP::Mixin::HasMethods::::BEGIN@12Class::MOP::Mixin::HasMethods::BEGIN@12
1115µs8µsClass::MOP::Mixin::HasMethods::::BEGIN@5Class::MOP::Mixin::HasMethods::BEGIN@5
0000s0sClass::MOP::Mixin::HasMethods::::_restore_metamethods_fromClass::MOP::Mixin::HasMethods::_restore_metamethods_from
0000s0sClass::MOP::Mixin::HasMethods::::get_method_listClass::MOP::Mixin::HasMethods::get_method_list
0000s0sClass::MOP::Mixin::HasMethods::::remove_methodClass::MOP::Mixin::HasMethods::remove_method
0000s0sClass::MOP::Mixin::HasMethods::::reset_package_cache_flagClass::MOP::Mixin::HasMethods::reset_package_cache_flag
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Class::MOP::Mixin::HasMethods;
21400nsour $VERSION = '2.1605';
3
4216µs212µs
# spent 10µs (8+2) within Class::MOP::Mixin::HasMethods::BEGIN@4 which was called: # once (8µs+2µs) by Class::MOP::BEGIN@16 at line 4
use strict;
# spent 10µs making 1 call to Class::MOP::Mixin::HasMethods::BEGIN@4 # spent 2µs making 1 call to strict::import
5213µs211µs
# spent 8µs (5+3) within Class::MOP::Mixin::HasMethods::BEGIN@5 which was called: # once (5µs+3µs) by Class::MOP::BEGIN@16 at line 5
use warnings;
# spent 8µs making 1 call to Class::MOP::Mixin::HasMethods::BEGIN@5 # spent 3µs making 1 call to warnings::import
6
7278µs11.52ms
# spent 1.52ms (322µs+1.20) within Class::MOP::Mixin::HasMethods::BEGIN@7 which was called: # once (322µs+1.20ms) by Class::MOP::BEGIN@16 at line 7
use Class::MOP::Method::Meta;
# spent 1.52ms making 1 call to Class::MOP::Mixin::HasMethods::BEGIN@7
8
9218µs265µs
# spent 35µs (6+30) within Class::MOP::Mixin::HasMethods::BEGIN@9 which was called: # once (6µs+30µs) by Class::MOP::BEGIN@16 at line 9
use Scalar::Util 'blessed', 'reftype';
# spent 35µs making 1 call to Class::MOP::Mixin::HasMethods::BEGIN@9 # spent 30µs making 1 call to Exporter::import
10288µs2383µs
# spent 359µs (172+187) within Class::MOP::Mixin::HasMethods::BEGIN@10 which was called: # once (172µs+187µs) by Class::MOP::BEGIN@16 at line 10
use Sub::Name 'subname';
# spent 359µs making 1 call to Class::MOP::Mixin::HasMethods::BEGIN@10 # spent 24µs making 1 call to Exporter::import
11
122570µs237µs
# spent 21µs (5+16) within Class::MOP::Mixin::HasMethods::BEGIN@12 which was called: # once (5µs+16µs) by Class::MOP::BEGIN@16 at line 12
use parent 'Class::MOP::Mixin';
# spent 21µs making 1 call to Class::MOP::Mixin::HasMethods::BEGIN@12 # spent 16µs making 1 call to parent::import
13
142535µs
# spent 26µs within Class::MOP::Mixin::HasMethods::_meta_method_class which was called 25 times, avg 1µs/call: # 23 times (24µs+0s) by Class::MOP::Mixin::HasMethods::_add_meta_method at line 24, avg 1µs/call # 2 times (2µs+0s) by Class::MOP::Mixin::HasMethods::_add_meta_method at line 22, avg 750ns/call
sub _meta_method_class { 'Class::MOP::Method::Meta' }
15
16
# spent 12.4ms (327µs+12.1) within Class::MOP::Mixin::HasMethods::_add_meta_method which was called 25 times, avg 495µs/call: # 20 times (249µs+10.2ms) by metaclass::import at line 39 of metaclass.pm, avg 523µs/call # 2 times (24µs+606µs) by Class::MOP::Class::create at line 446 of Class/MOP/Class.pm, avg 315µs/call # once (24µs+666µs) by Moose::Exporter::BEGIN@8 at line 721 of Class/MOP.pm # once (13µs+349µs) by Moose::init_meta at line 221 of Moose.pm # once (18µs+223µs) by Moose::Exporter::BEGIN@8 at line 727 of Class/MOP.pm
sub _add_meta_method {
17256µs my $self = shift;
182510µs my ($name) = @_;
1925100µs501.62ms my $existing_method = $self->can('find_method_by_name')
# spent 1.60ms making 25 calls to Class::MOP::Class::find_method_by_name, avg 64µs/call # spent 23µs making 25 calls to UNIVERSAL::can, avg 904ns/call
20 ? $self->find_method_by_name($name)
21 : $self->get_method($name);
222517µs65µs return if $existing_method
# spent 2µs making 2 calls to UNIVERSAL::isa, avg 1µs/call # spent 2µs making 2 calls to Class::MOP::Mixin::HasMethods::_meta_method_class, avg 750ns/call # spent 1µs making 2 calls to Class::MOP::Method::__ANON__[Class/MOP/Method.pm:16], avg 650ns/call
23 && $existing_method->isa($self->_meta_method_class);
2425183µs10010.4ms $self->add_method(
# spent 5.61ms making 2 calls to Moose::Meta::Method::Meta::wrap, avg 2.80ms/call # spent 3.61ms making 23 calls to Class::MOP::Method::Meta::wrap, avg 157µs/call # spent 1.18ms making 25 calls to Class::MOP::Mixin::HasMethods::add_method, avg 47µs/call # spent 24µs making 23 calls to Class::MOP::Mixin::HasMethods::_meta_method_class, avg 1µs/call # spent 6µs making 25 calls to Class::MOP::Package::name, avg 232ns/call # spent 2µs making 2 calls to Moose::Meta::Class::_meta_method_class, avg 1µs/call
25 $name => $self->_meta_method_class->wrap(
26 name => $name,
27 package_name => $self->name,
28 associated_metaclass => $self,
29 )
30 );
31}
32
33
# spent 1.34ms (434µs+911µs) within Class::MOP::Mixin::HasMethods::wrap_method_body which was called 67 times, avg 20µs/call: # 67 times (434µs+911µs) by Class::MOP::Mixin::HasMethods::get_method at line 116, avg 20µs/call
sub wrap_method_body {
346752µs my ( $self, %args ) = @_;
35
36 ( $args{body} && 'CODE' eq reftype $args{body} )
3767108µs6718µs || $self->_throw_exception( CodeBlockMustBeACodeRef => instance => $self,
# spent 18µs making 67 calls to Scalar::Util::reftype, avg 261ns/call
38 params => \%args
39 );
4067331µs201893µs $self->method_metaclass->wrap(
# spent 857µs making 67 calls to Class::MOP::Method::wrap, avg 13µs/call # spent 23µs making 67 calls to Class::MOP::Mixin::HasMethods::method_metaclass, avg 342ns/call # spent 13µs making 67 calls to Class::MOP::Package::name, avg 196ns/call
41 package_name => $self->name,
42 %args,
43 );
44}
45
46
# spent 27.6ms (17.6+9.97) within Class::MOP::Mixin::HasMethods::add_method which was called 401 times, avg 69µs/call: # 162 times (6.95ms+4.06ms) by Class::MOP::Attribute::install_accessors at line 450 of Class/MOP/Attribute.pm, avg 68µs/call # 47 times (783µs+1.34ms) by Class::MOP::Attribute::install_accessors at line 446 of Class/MOP/Attribute.pm, avg 45µs/call # 45 times (4.77ms+1.03ms) by Class::MOP::Attribute::install_accessors at line 458 of Class/MOP/Attribute.pm, avg 129µs/call # 43 times (675µs+1.06ms) by Class::MOP::Class::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Class/MOP/Class.pm:1082] at line 1080 of Class/MOP/Class.pm, avg 40µs/call # 31 times (3.39ms+795µs) by Class::MOP::Class::_inline_constructor at line 1467 of Class/MOP/Class.pm, avg 135µs/call # 25 times (470µs+708µs) by Class::MOP::Mixin::HasMethods::_add_meta_method at line 24, avg 47µs/call # 13 times (204µs+328µs) by Class::MOP::MiniTrait::apply at line 25 of Class/MOP/MiniTrait.pm, avg 41µs/call # 8 times (119µs+175µs) by Class::MOP::Attribute::install_accessors at line 454 of Class/MOP/Attribute.pm, avg 37µs/call # 7 times (66µs+116µs) by Moose::BEGIN@43 at line 26 of Moose/Meta/Attribute/Native.pm, avg 26µs/call # 3 times (31µs+49µs) by Moose::BEGIN@32 at line 315 of Moose/Meta/Role.pm, avg 26µs/call # 3 times (28µs+42µs) by Moose::BEGIN@32 at line 323 of Moose/Meta/Role.pm, avg 23µs/call # 3 times (26µs+42µs) by Moose::BEGIN@32 at line 342 of Moose/Meta/Role.pm, avg 23µs/call # 2 times (35µs+47µs) by Moose::Meta::Attribute::install_delegation at line 1105 of Moose/Meta/Attribute.pm, avg 41µs/call # 2 times (18µs+28µs) by Moose::BEGIN@32 at line 112 of Moose/Meta/Role.pm, avg 23µs/call # once (22µs+41µs) by Class::MOP::Attribute::install_accessors at line 462 of Class/MOP/Attribute.pm # once (18µs+23µs) by Class::MOP::Class::_inline_destructor at line 1509 of Class/MOP/Class.pm # once (12µs+26µs) by Moose::Exporter::BEGIN@8 at line 507 of Class/MOP.pm # once (10µs+18µs) by Moose::BEGIN@32 at line 92 of Moose/Meta/Role.pm # once (10µs+15µs) by Moose::BEGIN@32 at line 102 of Moose/Meta/Role.pm # once (9µs+14µs) by Moose::BEGIN@32 at line 97 of Moose/Meta/Role.pm # once (9µs+13µs) by Moose::BEGIN@32 at line 117 of Moose/Meta/Role.pm
sub add_method {
47401100µs my ( $self, $method_name, $method ) = @_;
48401112µs ( defined $method_name && length $method_name )
49 || $self->_throw_exception( MustDefineAMethodName => instance => $self );
50
51401587µs401127µs my $package_name = $self->name;
# spent 127µs making 401 calls to Class::MOP::Package::name, avg 318ns/call
52
5340134µs my $body;
544011.15ms779316µs if ( blessed($method) && $method->isa('Class::MOP::Method') ) {
# spent 164µs making 378 calls to UNIVERSAL::isa, avg 434ns/call # spent 152µs making 401 calls to Scalar::Util::blessed, avg 380ns/call
55378555µs378113µs $body = $method->body;
# spent 113µs making 378 calls to Class::MOP::Method::body, avg 299ns/call
56378542µs391174µs if ( $method->package_name ne $package_name ) {
# spent 93µs making 378 calls to Class::MOP::Method::package_name, avg 246ns/call # spent 81µs making 13 calls to Class::MOP::Method::clone, avg 6µs/call
57 $method = $method->clone(
58 package_name => $package_name,
59 name => $method_name,
60 );
61 }
62
63378281µs378891µs $method->attach_to_class($self);
# spent 891µs making 378 calls to Class::MOP::Method::attach_to_class, avg 2µs/call
64 }
65 else {
66 # If a raw code reference is supplied, its method object is not created.
67 # The method object won't be created until required.
68234µs $body = $method;
69 }
70
714014.15ms424625µs $self->_method_map->{$method_name} = $method;
# spent 621µs making 401 calls to Class::MOP::Mixin::HasMethods::_method_map, avg 2µs/call # spent 4µs making 23 calls to Class::MOP::Method::body, avg 187ns/call
72
73401761µs401256µs my ($current_package, $current_name) = Class::MOP::get_code_info($body);
# spent 256µs making 401 calls to Class::MOP::get_code_info, avg 639ns/call
74
754016.84ms7201.62ms subname($package_name . '::' . $method_name, $body)
# spent 1.22ms making 319 calls to Sub::Name::subname, avg 4µs/call # spent 399µs making 401 calls to Class::MOP::Mixin::HasMethods::CORE:match, avg 994ns/call
76 unless defined $current_name && $current_name !~ /^__ANON__/;
77
78401484µs4014.46ms $self->add_package_symbol("&$method_name", $body);
# spent 4.46ms making 401 calls to Class::MOP::Package::add_package_symbol, avg 11µs/call
79
80 # we added the method to the method map too, so it's still valid
81401826µs4011.39ms $self->update_package_cache_flag;
# spent 1.39ms making 401 calls to Class::MOP::Mixin::HasMethods::update_package_cache_flag, avg 3µs/call
82}
83
84
# spent 398µs (315+83) within Class::MOP::Mixin::HasMethods::_code_is_mine which was called 106 times, avg 4µs/call: # 106 times (315µs+83µs) by Class::MOP::Mixin::HasMethods::_get_maybe_raw_method at line 131, avg 4µs/call
sub _code_is_mine {
8510619µs my ( $self, $code ) = @_;
86
87106181µs10659µs my ( $code_package, $code_name ) = Class::MOP::get_code_info($code);
# spent 59µs making 106 calls to Class::MOP::get_code_info, avg 554ns/call
88
89106261µs10625µs return ( $code_package && $code_package eq $self->name )
# spent 25µs making 106 calls to Class::MOP::Package::name, avg 234ns/call
90 || ( $code_package eq 'constant' && $code_name eq '__ANON__' );
91}
92
93
# spent 596µs (113+483) within Class::MOP::Mixin::HasMethods::has_method which was called 44 times, avg 14µs/call: # 31 times (79µs+388µs) by Class::MOP::Class::_inline_constructor at line 1436 of Class/MOP/Class.pm, avg 15µs/call # 6 times (22µs+39µs) by Moose::Meta::Attribute::_process_accessors at line 1048 of Moose/Meta/Attribute.pm, avg 10µs/call # 6 times (10µs+47µs) by Class::MOP::Class::find_all_methods_by_name at line 1165 of Class/MOP/Class.pm, avg 10µs/call # once (2µs+9µs) by Class::MOP::Class::_inline_destructor at line 1480 of Class/MOP/Class.pm
sub has_method {
94449µs my ( $self, $method_name ) = @_;
95
964415µs ( defined $method_name && length $method_name )
97 || $self->_throw_exception( MustDefineAMethodName => instance => $self );
98
994431µs44483µs my $method = $self->_get_maybe_raw_method($method_name);
# spent 483µs making 44 calls to Class::MOP::Mixin::HasMethods::_get_maybe_raw_method, avg 11µs/call
1004454µs1200ns return if not $method;
101
10214µs1200ns return defined($self->_method_map->{$method_name} = $method);
# spent 200ns making 1 call to Class::MOP::Mixin::HasMethods::_method_map
103}
104
105
# spent 15.8ms (4.28+11.5) within Class::MOP::Mixin::HasMethods::get_method which was called 585 times, avg 27µs/call: # 345 times (864µs+4.69ms) by Class::MOP::Class::find_method_by_name at line 1133 of Class/MOP/Class.pm, avg 16µs/call # 150 times (3.14ms+1.98ms) by Class::MOP::Class::find_next_method_by_name at line 1181 of Class/MOP/Class.pm, avg 34µs/call # 43 times (65µs+348µs) by Class::MOP::Class::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Class/MOP/Class.pm:1082] at line 1055 of Class/MOP/Class.pm, avg 10µs/call # 38 times (187µs+4.35ms) by Class::MOP::Mixin::HasMethods::_full_method_map at line 220, avg 119µs/call # 6 times (25µs+86µs) by Moose::Meta::Attribute::_process_accessors at line 1021 of Moose/Meta/Attribute.pm, avg 18µs/call # 2 times (4µs+19µs) by Moose::Meta::Attribute::install_delegation at line 1084 of Moose/Meta/Attribute.pm, avg 12µs/call # once (3µs+14µs) by Moose::init_meta at line 211 of Moose.pm
sub get_method {
10658581µs my ( $self, $method_name ) = @_;
107
10858579µs ( defined $method_name && length $method_name )
109 || $self->_throw_exception( MustDefineAMethodName => instance => $self );
110
111585288µs5859.87ms my $method = $self->_get_maybe_raw_method($method_name);
# spent 9.87ms making 585 calls to Class::MOP::Mixin::HasMethods::_get_maybe_raw_method, avg 17µs/call
112585564µs8848µs return if not $method;
# spent 48µs making 88 calls to Class::MOP::Method::__ANON__[Class/MOP/Method.pm:16], avg 544ns/call
113
1141553.04ms243106µs return $method if blessed($method) && $method->isa('Class::MOP::Method');
# spent 55µs making 155 calls to Scalar::Util::blessed, avg 355ns/call # spent 51µs making 88 calls to UNIVERSAL::isa, avg 576ns/call
115
11667245µs1341.46ms return $self->_method_map->{$method_name} = $self->wrap_method_body(
# spent 1.34ms making 67 calls to Class::MOP::Mixin::HasMethods::wrap_method_body, avg 20µs/call # spent 89µs making 13 calls to Class::MOP::Class::Immutable::Class::MOP::Class::_method_map, avg 7µs/call # spent 24µs making 54 calls to Class::MOP::Mixin::HasMethods::_method_map, avg 446ns/call
117 body => $method,
118 name => $method_name,
119 associated_metaclass => $self,
120 );
121}
122
123
# spent 10.4ms (2.11+8.25) within Class::MOP::Mixin::HasMethods::_get_maybe_raw_method which was called 629 times, avg 16µs/call: # 585 times (1.94ms+7.94ms) by Class::MOP::Mixin::HasMethods::get_method at line 111, avg 17µs/call # 44 times (171µs+312µs) by Class::MOP::Mixin::HasMethods::has_method at line 99, avg 11µs/call
sub _get_maybe_raw_method {
12462987µs my ( $self, $method_name ) = @_;
125
1266291.07ms6362.05ms my $map_entry = $self->_method_map->{$method_name};
# spent 1.66ms making 233 calls to Class::MOP::Class::Immutable::Class::MOP::Class::_method_map, avg 7µs/call # spent 390µs making 396 calls to Class::MOP::Mixin::HasMethods::_method_map, avg 984ns/call # spent 3µs making 7 calls to Class::MOP::Method::body, avg 429ns/call
127629152µs return $map_entry if defined $map_entry;
128
129540470µs5405.80ms my $code = $self->get_package_symbol("&$method_name");
# spent 5.80ms making 540 calls to Class::MOP::Package::get_package_symbol, avg 11µs/call
130
131540571µs106398µs return unless $code && $self->_code_is_mine($code);
# spent 398µs making 106 calls to Class::MOP::Mixin::HasMethods::_code_is_mine, avg 4µs/call
132
1336769µs return $code;
134}
135
136sub remove_method {
137 my ( $self, $method_name ) = @_;
138
139 ( defined $method_name && length $method_name )
140 || $self->_throw_exception( MustDefineAMethodName => instance => $self );
141
142 my $removed_method = delete $self->_method_map->{$method_name};
143
144 $self->remove_package_symbol("&$method_name");
145
146 $removed_method->detach_from_class
147 if blessed($removed_method) && $removed_method->isa('Class::MOP::Method');
148
149 # still valid, since we just removed the method from the map
150 $self->update_package_cache_flag;
151
152 return $removed_method;
153}
154
155sub get_method_list {
156 my $self = shift;
157
158 return keys %{ $self->_full_method_map };
159}
160
161
# spent 4.79ms (49µs+4.75) within Class::MOP::Mixin::HasMethods::_get_local_methods which was called 15 times, avg 320µs/call: # 15 times (49µs+4.75ms) by Class::MOP::Class::get_all_methods at line 1146 of Class/MOP/Class.pm, avg 320µs/call
sub _get_local_methods {
162153µs my $self = shift;
163
1641545µs154.75ms return values %{ $self->_full_method_map };
# spent 4.75ms making 15 calls to Class::MOP::Mixin::HasMethods::_full_method_map, avg 316µs/call
165}
166
167sub _restore_metamethods_from {
168 my $self = shift;
169 my ($old_meta) = @_;
170
171 my $package_name = $self->name;
172
173 # Check if Perl debugger is enabled
174 my $debugger_enabled = ($^P & 0x10);
175 my $debug_method_info;
176
177 for my $method ($old_meta->_get_local_methods) {
178 my $method_name = $method->name;
179
180 # Track DB::sub information for this method if debugger is enabled.
181 # This contains original method filename and line numbers.
182 $debug_method_info = '';
183 if ($debugger_enabled) {
184 $debug_method_info = $DB::sub{$package_name . "::" . $method_name}
185 }
186
187 $method->_make_compatible_with($self->method_metaclass);
188 $self->add_method($method_name => $method);
189
190 # Restore method debug information, which can be clobbered by add_method.
191 # Note that we handle this here instead of in add_method, because we
192 # only want to preserve the original debug info in cases where we are
193 # restoring a method, not overwriting a method.
194 if ($debugger_enabled && $debug_method_info) {
195 $DB::sub{$package_name . "::" . $method_name} = $debug_method_info;
196 }
197 }
198}
199
200sub reset_package_cache_flag { (shift)->{'_package_cache_flag'} = undef }
201
# spent 1.39ms (1.10+288µs) within Class::MOP::Mixin::HasMethods::update_package_cache_flag which was called 401 times, avg 3µs/call: # 401 times (1.10ms+288µs) by Class::MOP::Mixin::HasMethods::add_method at line 81, avg 3µs/call
sub update_package_cache_flag {
20240160µs my $self = shift;
203 # NOTE:
204 # we can manually update the cache number
205 # since we are actually adding the method
206 # to our cache as well. This avoids us
207 # having to regenerate the method_map.
208 # - SL
2094015.65ms802288µs $self->{'_package_cache_flag'} = Class::MOP::check_package_cache_flag($self->name);
# spent 196µs making 401 calls to mro::get_pkg_gen, avg 488ns/call # spent 92µs making 401 calls to Class::MOP::Package::name, avg 230ns/call
210}
211
212
# spent 4.75ms (142µs+4.60) within Class::MOP::Mixin::HasMethods::_full_method_map which was called 15 times, avg 316µs/call: # 15 times (142µs+4.60ms) by Class::MOP::Mixin::HasMethods::_get_local_methods at line 164, avg 316µs/call
sub _full_method_map {
213153µs my $self = shift;
214
2151546µs3012µs my $pkg_gen = Class::MOP::check_package_cache_flag($self->name);
# spent 8µs making 15 calls to mro::get_pkg_gen, avg 533ns/call # spent 4µs making 15 calls to Class::MOP::Package::name, avg 247ns/call
216
217159µs if (($self->{_package_cache_flag_full} || -1) != $pkg_gen) {
218 # forcibly reify all method map entries
219 $self->get_method($_)
220436µs424.58ms for $self->list_all_package_symbols('CODE');
# spent 4.54ms making 38 calls to Class::MOP::Mixin::HasMethods::get_method, avg 119µs/call # spent 41µs making 4 calls to Class::MOP::Package::list_all_package_symbols, avg 10µs/call
22143µs $self->{_package_cache_flag_full} = $pkg_gen;
222 }
223
2241554µs1512µs return $self->_method_map;
# spent 12µs making 15 calls to Class::MOP::Mixin::HasMethods::_method_map, avg 800ns/call
225}
226
22712µs1;
228
229# ABSTRACT: Methods for metaclasses which have methods
230
231__END__
 
# spent 399µs within Class::MOP::Mixin::HasMethods::CORE:match which was called 401 times, avg 994ns/call: # 401 times (399µs+0s) by Class::MOP::Mixin::HasMethods::add_method at line 75, avg 994ns/call
sub Class::MOP::Mixin::HasMethods::CORE:match; # opcode