Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Role/Application/RoleSummation.pm |
Statements | Executed 1042 statements in 2.60ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 774µs | 9.58ms | apply_methods | Moose::Meta::Role::Application::RoleSummation::
3 | 1 | 1 | 175µs | 1.25ms | apply_attributes | Moose::Meta::Role::Application::RoleSummation::
16 | 2 | 1 | 148µs | 201µs | get_method_aliases_for_role | Moose::Meta::Role::Application::RoleSummation::
9 | 3 | 1 | 124µs | 292µs | apply_method_modifiers | Moose::Meta::Role::Application::RoleSummation::
3 | 1 | 1 | 120µs | 553µs | check_required_methods | Moose::Meta::Role::Application::RoleSummation::
3 | 1 | 1 | 101µs | 153µs | check_role_exclusions | Moose::Meta::Role::Application::RoleSummation::
3 | 1 | 1 | 96µs | 226µs | apply_override_method_modifiers | Moose::Meta::Role::Application::RoleSummation::
8 | 1 | 1 | 79µs | 105µs | get_exclusions_for_role | Moose::Meta::Role::Application::RoleSummation::
8 | 1 | 1 | 45µs | 137µs | is_aliased_method | Moose::Meta::Role::Application::RoleSummation::
1 | 1 | 1 | 9µs | 9µs | BEGIN@2 | Moose::Meta::Role::Application::RoleSummation::
1 | 1 | 1 | 6µs | 9µs | BEGIN@10 | Moose::Meta::Role::Application::RoleSummation::
1 | 1 | 1 | 6µs | 26µs | BEGIN@13 | Moose::Meta::Role::Application::RoleSummation::
1 | 1 | 1 | 6µs | 16µs | BEGIN@9 | Moose::Meta::Role::Application::RoleSummation::
1 | 1 | 1 | 6µs | 54µs | BEGIN@17 | Moose::Meta::Role::Application::RoleSummation::
1 | 1 | 1 | 5µs | 326µs | BEGIN@11 | Moose::Meta::Role::Application::RoleSummation::
1 | 1 | 1 | 3µs | 3µs | BEGIN@15 | Moose::Meta::Role::Application::RoleSummation::
3 | 1 | 1 | 2µs | 2µs | check_required_attributes | Moose::Meta::Role::Application::RoleSummation::
0 | 0 | 0 | 0s | 0s | __ANON__[:21] | Moose::Meta::Role::Application::RoleSummation::
0 | 0 | 0 | 0s | 0s | is_method_aliased | Moose::Meta::Role::Application::RoleSummation::
0 | 0 | 0 | 0s | 0s | is_method_excluded | Moose::Meta::Role::Application::RoleSummation::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Meta::Role::Application::RoleSummation; | ||||
2 | # spent 9µs within Moose::Meta::Role::Application::RoleSummation::BEGIN@2 which was called:
# once (9µs+0s) by Moose::BEGIN@38 at line 4 | ||||
3 | 1 | 4µs | $Moose::Meta::Role::Application::RoleSummation::AUTHORITY = 'cpan:STEVAN'; | ||
4 | 1 | 29µs | 1 | 9µs | } # spent 9µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@2 |
5 | { | ||||
6 | 2 | 700ns | $Moose::Meta::Role::Application::RoleSummation::VERSION = '2.1005'; | ||
7 | } | ||||
8 | |||||
9 | 2 | 23µs | 2 | 26µs | # spent 16µs (6+10) within Moose::Meta::Role::Application::RoleSummation::BEGIN@9 which was called:
# once (6µs+10µs) by Moose::BEGIN@38 at line 9 # spent 16µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@9
# spent 10µs making 1 call to strict::import |
10 | 2 | 18µs | 2 | 12µs | # spent 9µs (6+3) within Moose::Meta::Role::Application::RoleSummation::BEGIN@10 which was called:
# once (6µs+3µs) by Moose::BEGIN@38 at line 10 # spent 9µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@10
# spent 3µs making 1 call to warnings::import |
11 | 2 | 25µs | 2 | 647µs | # spent 326µs (5+321) within Moose::Meta::Role::Application::RoleSummation::BEGIN@11 which was called:
# once (5µs+321µs) by Moose::BEGIN@38 at line 11 # spent 326µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@11
# spent 321µs making 1 call to metaclass::import |
12 | |||||
13 | 2 | 25µs | 2 | 46µs | # spent 26µs (6+20) within Moose::Meta::Role::Application::RoleSummation::BEGIN@13 which was called:
# once (6µs+20µs) by Moose::BEGIN@38 at line 13 # spent 26µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@13
# spent 20µs making 1 call to Exporter::import |
14 | |||||
15 | 2 | 22µs | 1 | 3µs | # spent 3µs within Moose::Meta::Role::Application::RoleSummation::BEGIN@15 which was called:
# once (3µs+0s) by Moose::BEGIN@38 at line 15 # spent 3µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@15 |
16 | |||||
17 | 2 | 1.17ms | 2 | 102µs | # spent 54µs (6+48) within Moose::Meta::Role::Application::RoleSummation::BEGIN@17 which was called:
# once (6µs+48µs) by Moose::BEGIN@38 at line 17 # spent 54µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@17
# spent 48µs making 1 call to base::import |
18 | |||||
19 | __PACKAGE__->meta->add_attribute('role_params' => ( | ||||
20 | reader => 'role_params', | ||||
21 | default => sub { {} }, | ||||
22 | 1 | 5µs | 3 | 297µs | Class::MOP::_definition_context(), # spent 278µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 15µs making 1 call to Moose::Meta::Role::Application::RoleSummation::meta
# spent 5µs making 1 call to Class::MOP::_definition_context |
23 | )); | ||||
24 | |||||
25 | # spent 105µs (79+26) within Moose::Meta::Role::Application::RoleSummation::get_exclusions_for_role which was called 8 times, avg 13µs/call:
# 8 times (79µs+26µs) by Moose::Meta::Role::Application::RoleSummation::apply_methods at line 161, avg 13µs/call | ||||
26 | 8 | 1µs | my ($self, $role) = @_; | ||
27 | 8 | 30µs | 16 | 7µs | $role = $role->name if blessed $role; # spent 4µs making 8 calls to Scalar::Util::blessed, avg 438ns/call
# spent 3µs making 8 calls to Class::MOP::Package::name, avg 400ns/call |
28 | 8 | 8µs | 8 | 7µs | my $excludes_key = exists $self->role_params->{$role}->{'-excludes'} ? # spent 7µs making 8 calls to Moose::Meta::Role::Application::RoleSummation::role_params, avg 862ns/call |
29 | '-excludes' : 'excludes'; | ||||
30 | 8 | 12µs | 16 | 12µs | if ($self->role_params->{$role} && defined $self->role_params->{$role}->{$excludes_key}) { # spent 12µs making 16 calls to Moose::Meta::Role::Application::RoleSummation::role_params, avg 756ns/call |
31 | if (ref $self->role_params->{$role}->{$excludes_key} eq 'ARRAY') { | ||||
32 | return $self->role_params->{$role}->{$excludes_key}; | ||||
33 | } | ||||
34 | return [ $self->role_params->{$role}->{$excludes_key} ]; | ||||
35 | } | ||||
36 | 8 | 15µs | return []; | ||
37 | } | ||||
38 | |||||
39 | # spent 201µs (148+53) within Moose::Meta::Role::Application::RoleSummation::get_method_aliases_for_role which was called 16 times, avg 13µs/call:
# 8 times (83µs+30µs) by Moose::Meta::Role::Application::RoleSummation::apply_methods at line 160, avg 14µs/call
# 8 times (65µs+23µs) by Moose::Meta::Role::Application::RoleSummation::is_aliased_method at line 65, avg 11µs/call | ||||
40 | 16 | 3µs | my ($self, $role) = @_; | ||
41 | 16 | 46µs | 24 | 11µs | $role = $role->name if blessed $role; # spent 7µs making 16 calls to Scalar::Util::blessed, avg 419ns/call
# spent 4µs making 8 calls to Class::MOP::Package::name, avg 488ns/call |
42 | 16 | 20µs | 16 | 18µs | my $alias_key = exists $self->role_params->{$role}->{'-alias'} ? # spent 18µs making 16 calls to Moose::Meta::Role::Application::RoleSummation::role_params, avg 1µs/call |
43 | '-alias' : 'alias'; | ||||
44 | 16 | 23µs | 32 | 24µs | if ($self->role_params->{$role} && defined $self->role_params->{$role}->{$alias_key}) { # spent 24µs making 32 calls to Moose::Meta::Role::Application::RoleSummation::role_params, avg 756ns/call |
45 | return $self->role_params->{$role}->{$alias_key}; | ||||
46 | } | ||||
47 | 16 | 30µs | return {}; | ||
48 | } | ||||
49 | |||||
50 | sub is_method_excluded { | ||||
51 | my ($self, $role, $method_name) = @_; | ||||
52 | foreach ($self->get_exclusions_for_role($role->name)) { | ||||
53 | return 1 if $_ eq $method_name; | ||||
54 | } | ||||
55 | return 0; | ||||
56 | } | ||||
57 | |||||
58 | sub is_method_aliased { | ||||
59 | my ($self, $role, $method_name) = @_; | ||||
60 | exists $self->get_method_aliases_for_role($role->name)->{$method_name} ? 1 : 0 | ||||
61 | } | ||||
62 | |||||
63 | # spent 137µs (45+92) within Moose::Meta::Role::Application::RoleSummation::is_aliased_method which was called 8 times, avg 17µs/call:
# 8 times (45µs+92µs) by Moose::Meta::Role::Application::RoleSummation::check_required_methods at line 106, avg 17µs/call | ||||
64 | 8 | 2µs | my ($self, $role, $method_name) = @_; | ||
65 | 8 | 28µs | 16 | 92µs | my %aliased_names = reverse %{$self->get_method_aliases_for_role($role->name)}; # spent 88µs making 8 calls to Moose::Meta::Role::Application::RoleSummation::get_method_aliases_for_role, avg 11µs/call
# spent 3µs making 8 calls to Class::MOP::Package::name, avg 400ns/call |
66 | 8 | 15µs | exists $aliased_names{$method_name} ? 1 : 0; | ||
67 | } | ||||
68 | |||||
69 | # spent 153µs (101+52) within Moose::Meta::Role::Application::RoleSummation::check_role_exclusions which was called 3 times, avg 51µs/call:
# 3 times (101µs+52µs) by Moose::Meta::Role::Application::apply at line 54 of Moose/Meta/Role/Application.pm, avg 51µs/call | ||||
70 | 3 | 900ns | my ($self, $c) = @_; | ||
71 | |||||
72 | 3 | 700ns | my %excluded_roles; | ||
73 | 3 | 7µs | 3 | 4µs | for my $role (@{ $c->get_roles }) { # spent 4µs making 3 calls to Moose::Meta::Role::get_roles, avg 1µs/call |
74 | 8 | 18µs | 8 | 4µs | my $name = $role->name; # spent 4µs making 8 calls to Class::MOP::Package::name, avg 538ns/call |
75 | |||||
76 | 8 | 24µs | 8 | 33µs | for my $excluded ($role->get_excluded_roles_list) { # spent 33µs making 8 calls to Moose::Meta::Role::get_excluded_roles_list, avg 4µs/call |
77 | push @{ $excluded_roles{$excluded} }, $name; | ||||
78 | } | ||||
79 | } | ||||
80 | |||||
81 | 3 | 4µs | 3 | 3µs | foreach my $role (@{$c->get_roles}) { # spent 3µs making 3 calls to Moose::Meta::Role::get_roles, avg 900ns/call |
82 | 8 | 5µs | foreach my $excluded (keys %excluded_roles) { | ||
83 | next unless $role->does_role($excluded); | ||||
84 | |||||
85 | my @excluding = @{ $excluded_roles{$excluded} }; | ||||
86 | |||||
87 | require Moose; | ||||
88 | Moose->throw_error(sprintf "Conflict detected: Role%s %s exclude%s role '%s'", (@excluding == 1 ? '' : 's'), join(', ', @excluding), (@excluding == 1 ? 's' : ''), $excluded); | ||||
89 | } | ||||
90 | } | ||||
91 | |||||
92 | 3 | 13µs | 3 | 8µs | $c->add_excluded_roles(keys %excluded_roles); # spent 8µs making 3 calls to Moose::Meta::Role::add_excluded_roles, avg 3µs/call |
93 | } | ||||
94 | |||||
95 | # spent 553µs (120+433) within Moose::Meta::Role::Application::RoleSummation::check_required_methods which was called 3 times, avg 184µs/call:
# 3 times (120µs+433µs) by Moose::Meta::Role::Application::apply at line 55 of Moose/Meta/Role/Application.pm, avg 184µs/call | ||||
96 | 3 | 1µs | my ($self, $c) = @_; | ||
97 | |||||
98 | 5 | 5µs | 5 | 6µs | my %all_required_methods = # spent 6µs making 5 calls to Moose::Meta::Role::Method::Required::name, avg 1µs/call |
99 | 8 | 7µs | 8 | 30µs | map { $_->name => $_ } # spent 30µs making 8 calls to Moose::Meta::Role::get_required_method_list, avg 4µs/call |
100 | map { $_->get_required_method_list } | ||||
101 | 3 | 11µs | 3 | 2µs | @{$c->get_roles}; # spent 2µs making 3 calls to Moose::Meta::Role::get_roles, avg 833ns/call |
102 | |||||
103 | 3 | 4µs | 3 | 3µs | foreach my $role (@{$c->get_roles}) { # spent 3µs making 3 calls to Moose::Meta::Role::get_roles, avg 1µs/call |
104 | 8 | 6µs | foreach my $required (keys %all_required_methods) { | ||
105 | |||||
106 | 10 | 24µs | 18 | 362µs | delete $all_required_methods{$required} # spent 225µs making 10 calls to Class::MOP::Mixin::HasMethods::has_method, avg 22µs/call
# spent 137µs making 8 calls to Moose::Meta::Role::Application::RoleSummation::is_aliased_method, avg 17µs/call |
107 | if $role->has_method($required) | ||||
108 | || $self->is_aliased_method($role, $required); | ||||
109 | } | ||||
110 | } | ||||
111 | |||||
112 | 3 | 11µs | 3 | 30µs | $c->add_required_methods(values %all_required_methods); # spent 30µs making 3 calls to Moose::Meta::Role::add_required_methods, avg 10µs/call |
113 | } | ||||
114 | |||||
115 | 3 | 6µs | # spent 2µs within Moose::Meta::Role::Application::RoleSummation::check_required_attributes which was called 3 times, avg 800ns/call:
# 3 times (2µs+0s) by Moose::Meta::Role::Application::apply at line 56 of Moose/Meta/Role/Application.pm, avg 800ns/call | ||
116 | |||||
117 | } | ||||
118 | |||||
119 | # spent 1.25ms (175µs+1.08) within Moose::Meta::Role::Application::RoleSummation::apply_attributes which was called 3 times, avg 418µs/call:
# 3 times (175µs+1.08ms) by Moose::Meta::Role::Application::apply at line 58 of Moose/Meta/Role/Application.pm, avg 418µs/call | ||||
120 | 3 | 800ns | my ($self, $c) = @_; | ||
121 | |||||
122 | 3 | 600ns | my @all_attributes; | ||
123 | |||||
124 | 3 | 4µs | 3 | 3µs | for my $role ( @{ $c->get_roles } ) { # spent 3µs making 3 calls to Moose::Meta::Role::get_roles, avg 1µs/call |
125 | 17 | 14µs | 17 | 44µs | push @all_attributes, # spent 44µs making 17 calls to Class::MOP::Mixin::HasAttributes::get_attribute, avg 3µs/call |
126 | 8 | 14µs | 8 | 24µs | map { $role->get_attribute($_) } $role->get_attribute_list; # spent 24µs making 8 calls to Class::MOP::Mixin::HasAttributes::get_attribute_list, avg 3µs/call |
127 | } | ||||
128 | |||||
129 | 3 | 500ns | my %seen; | ||
130 | 3 | 2µs | foreach my $attr (@all_attributes) { | ||
131 | 17 | 29µs | 17 | 6µs | my $name = $attr->name; # spent 6µs making 17 calls to Class::MOP::Mixin::AttributeCore::name, avg 376ns/call |
132 | |||||
133 | 17 | 2µs | if ( exists $seen{$name} ) { | ||
134 | next if $seen{$name}->is_same_as($attr); | ||||
135 | |||||
136 | my $role1 = $seen{$name}->associated_role->name; | ||||
137 | my $role2 = $attr->associated_role->name; | ||||
138 | |||||
139 | require Moose; | ||||
140 | Moose->throw_error( | ||||
141 | "We have encountered an attribute conflict with '$name' " | ||||
142 | . "during role composition. " | ||||
143 | . " This attribute is defined in both $role1 and $role2." | ||||
144 | . " This is a fatal error and cannot be disambiguated." ); | ||||
145 | } | ||||
146 | |||||
147 | 17 | 7µs | $seen{$name} = $attr; | ||
148 | } | ||||
149 | |||||
150 | 3 | 9µs | foreach my $attr (@all_attributes) { | ||
151 | 17 | 32µs | 34 | 1.00ms | $c->add_attribute( $attr->clone ); # spent 653µs making 17 calls to Moose::Meta::Role::add_attribute, avg 38µs/call
# spent 348µs making 17 calls to Moose::Meta::Role::Attribute::clone, avg 20µs/call |
152 | } | ||||
153 | } | ||||
154 | |||||
155 | # spent 9.58ms (774µs+8.81) within Moose::Meta::Role::Application::RoleSummation::apply_methods which was called 3 times, avg 3.19ms/call:
# 3 times (774µs+8.81ms) by Moose::Meta::Role::Application::apply at line 59 of Moose/Meta/Role/Application.pm, avg 3.19ms/call | ||||
156 | 3 | 800ns | my ($self, $c) = @_; | ||
157 | |||||
158 | 8 | 1µs | my @all_methods = map { | ||
159 | my $role = $_; | ||||
160 | 8 | 9µs | 8 | 113µs | my $aliases = $self->get_method_aliases_for_role($role); # spent 113µs making 8 calls to Moose::Meta::Role::Application::RoleSummation::get_method_aliases_for_role, avg 14µs/call |
161 | 8 | 10µs | 8 | 105µs | my %excludes = map { $_ => undef } @{ $self->get_exclusions_for_role($role) }; # spent 105µs making 8 calls to Moose::Meta::Role::Application::RoleSummation::get_exclusions_for_role, avg 13µs/call |
162 | ( | ||||
163 | 63 | 102µs | 63 | 592µs | (map { # spent 592µs making 63 calls to Class::MOP::Mixin::HasMethods::get_method, avg 9µs/call |
164 | 63 | 110µs | 63 | 22µs | exists $excludes{$_} ? () : # spent 22µs making 63 calls to Class::MOP::Method::name, avg 343ns/call |
165 | +{ | ||||
166 | role => $role, | ||||
167 | name => $_, | ||||
168 | method => $role->get_method($_), | ||||
169 | } | ||||
170 | 71 | 149µs | 71 | 48µs | } map { $_->name } # spent 48µs making 71 calls to UNIVERSAL::isa, avg 682ns/call |
171 | grep { !$_->isa('Class::MOP::Method::Meta') } | ||||
172 | $role->_get_local_methods), | ||||
173 | (map { | ||||
174 | 8 | 59µs | 8 | 3.11ms | +{ # spent 3.11ms making 8 calls to Class::MOP::Mixin::HasMethods::_get_local_methods, avg 389µs/call |
175 | role => $role, | ||||
176 | name => $aliases->{$_}, | ||||
177 | method => $role->get_method($_), | ||||
178 | } | ||||
179 | } keys %$aliases) | ||||
180 | ); | ||||
181 | 3 | 17µs | 3 | 3µs | } @{$c->get_roles}; # spent 3µs making 3 calls to Moose::Meta::Role::get_roles, avg 900ns/call |
182 | |||||
183 | 3 | 700ns | my (%seen, %conflicts, %method_map); | ||
184 | 3 | 2µs | foreach my $method (@all_methods) { | ||
185 | 63 | 8µs | next if $conflicts{$method->{name}}; | ||
186 | 63 | 12µs | my $seen = $seen{$method->{name}}; | ||
187 | |||||
188 | 63 | 700ns | if ($seen) { | ||
189 | 2 | 13µs | 4 | 2µs | if ($seen->{method}->body != $method->{method}->body) { # spent 2µs making 4 calls to Class::MOP::Method::body, avg 575ns/call |
190 | 2 | 15µs | 6 | 127µs | $c->add_conflicting_method( # spent 125µs making 2 calls to Moose::Meta::Role::add_conflicting_method, avg 63µs/call
# spent 1µs making 4 calls to Class::MOP::Package::name, avg 350ns/call |
191 | name => $method->{name}, | ||||
192 | roles => [$method->{role}->name, $seen->{role}->name], | ||||
193 | ); | ||||
194 | |||||
195 | 2 | 1µs | delete $method_map{$method->{name}}; | ||
196 | 2 | 800ns | $conflicts{$method->{name}} = 1; | ||
197 | 2 | 800ns | next; | ||
198 | } | ||||
199 | } | ||||
200 | |||||
201 | 61 | 16µs | $seen{$method->{name}} = $method; | ||
202 | 61 | 23µs | $method_map{$method->{name}} = $method->{method}; | ||
203 | } | ||||
204 | |||||
205 | 3 | 86µs | 59 | 4.69ms | $c->add_method($_ => $method_map{$_}) for keys %method_map; # spent 4.69ms making 59 calls to Moose::Meta::Role::Composite::add_method, avg 80µs/call |
206 | } | ||||
207 | |||||
208 | # spent 226µs (96+130) within Moose::Meta::Role::Application::RoleSummation::apply_override_method_modifiers which was called 3 times, avg 75µs/call:
# 3 times (96µs+130µs) by Moose::Meta::Role::Application::apply at line 61 of Moose/Meta/Role/Application.pm, avg 75µs/call | ||||
209 | 3 | 800ns | my ($self, $c) = @_; | ||
210 | |||||
211 | 8 | 1µs | my @all_overrides = map { | ||
212 | my $role = $_; | ||||
213 | 6 | 8µs | 6 | 19µs | map { # spent 19µs making 6 calls to Moose::Meta::Role::get_override_method_modifier, avg 3µs/call |
214 | 8 | 10µs | 8 | 36µs | +{ # spent 36µs making 8 calls to Moose::Meta::Role::get_method_modifier_list, avg 5µs/call |
215 | name => $_, | ||||
216 | method => $role->get_override_method_modifier($_), | ||||
217 | } | ||||
218 | } $role->get_method_modifier_list('override'); | ||||
219 | 3 | 7µs | 3 | 3µs | } @{$c->get_roles}; # spent 3µs making 3 calls to Moose::Meta::Role::get_roles, avg 933ns/call |
220 | |||||
221 | 3 | 600ns | my %seen; | ||
222 | 3 | 2µs | foreach my $override (@all_overrides) { | ||
223 | 6 | 7µs | 6 | 23µs | if ( $c->has_method($override->{name}) ){ # spent 23µs making 6 calls to Moose::Meta::Role::Composite::has_method, avg 4µs/call |
224 | require Moose; | ||||
225 | Moose->throw_error( "Role '" . $c->name . "' has encountered an 'override' method conflict " . | ||||
226 | "during composition (A local method of the same name as been found). This " . | ||||
227 | "is fatal error." ) | ||||
228 | } | ||||
229 | 6 | 2µs | if (exists $seen{$override->{name}}) { | ||
230 | if ( $seen{$override->{name}} != $override->{method} ) { | ||||
231 | require Moose; | ||||
232 | Moose->throw_error( "We have encountered an 'override' method conflict during " . | ||||
233 | "composition (Two 'override' methods of the same name encountered). " . | ||||
234 | "This is fatal error.") | ||||
235 | } | ||||
236 | } | ||||
237 | 6 | 4µs | $seen{$override->{name}} = $override->{method}; | ||
238 | } | ||||
239 | |||||
240 | $c->add_override_method_modifier( | ||||
241 | $_->{name}, $_->{method} | ||||
242 | 3 | 19µs | 6 | 49µs | ) for @all_overrides; # spent 49µs making 6 calls to Moose::Meta::Role::add_override_method_modifier, avg 8µs/call |
243 | |||||
244 | } | ||||
245 | |||||
246 | # spent 292µs (124+168) within Moose::Meta::Role::Application::RoleSummation::apply_method_modifiers which was called 9 times, avg 32µs/call:
# 3 times (56µs+99µs) by Moose::Meta::Role::Application::apply_around_method_modifiers at line 78 of Moose/Meta/Role/Application.pm, avg 52µs/call
# 3 times (40µs+34µs) by Moose::Meta::Role::Application::apply_before_method_modifiers at line 77 of Moose/Meta/Role/Application.pm, avg 24µs/call
# 3 times (29µs+34µs) by Moose::Meta::Role::Application::apply_after_method_modifiers at line 79 of Moose/Meta/Role/Application.pm, avg 21µs/call | ||||
247 | 9 | 3µs | my ($self, $modifier_type, $c) = @_; | ||
248 | 9 | 4µs | my $add = "add_${modifier_type}_method_modifier"; | ||
249 | 9 | 2µs | my $get = "get_${modifier_type}_method_modifiers"; | ||
250 | 9 | 23µs | 9 | 8µs | foreach my $role (@{$c->get_roles}) { # spent 8µs making 9 calls to Moose::Meta::Role::get_roles, avg 833ns/call |
251 | 24 | 32µs | 24 | 95µs | foreach my $method_name ($role->get_method_modifier_list($modifier_type)) { # spent 95µs making 24 calls to Moose::Meta::Role::get_method_modifier_list, avg 4µs/call |
252 | $c->$add( | ||||
253 | $method_name, | ||||
254 | $_ | ||||
255 | 5 | 15µs | 10 | 65µs | ) foreach $role->$get($method_name); # spent 47µs making 5 calls to Moose::Meta::Role::add_around_method_modifier, avg 9µs/call
# spent 18µs making 5 calls to Moose::Meta::Role::get_around_method_modifiers, avg 4µs/call |
256 | } | ||||
257 | } | ||||
258 | } | ||||
259 | |||||
260 | 1 | 4µs | 1; | ||
261 | |||||
262 | # ABSTRACT: Combine two or more roles | ||||
263 | |||||
264 | __END__ |