| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/Role/Application/RoleSummation.pm |
| Statements | Executed 2884 statements in 45.3ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 9 | 1 | 1 | 20.5ms | 203ms | Moose::Meta::Role::Application::RoleSummation::apply_methods |
| 27 | 3 | 1 | 4.14ms | 13.7ms | Moose::Meta::Role::Application::RoleSummation::apply_method_modifiers |
| 9 | 1 | 1 | 3.70ms | 11.5ms | Moose::Meta::Role::Application::RoleSummation::apply_override_method_modifiers |
| 43 | 2 | 1 | 3.24ms | 4.92ms | Moose::Meta::Role::Application::RoleSummation::get_method_aliases_for_role |
| 9 | 1 | 1 | 2.18ms | 13.7ms | Moose::Meta::Role::Application::RoleSummation::check_required_methods |
| 20 | 1 | 1 | 1.90ms | 2.89ms | Moose::Meta::Role::Application::RoleSummation::get_exclusions_for_role |
| 9 | 1 | 1 | 1.50ms | 2.75ms | Moose::Meta::Role::Application::RoleSummation::check_role_exclusions |
| 23 | 1 | 1 | 966µs | 3.45ms | Moose::Meta::Role::Application::RoleSummation::is_aliased_method |
| 9 | 1 | 1 | 737µs | 1.50ms | Moose::Meta::Role::Application::RoleSummation::apply_attributes |
| 1 | 1 | 1 | 78µs | 95µs | Moose::Meta::Role::Application::RoleSummation::BEGIN@3 |
| 9 | 1 | 1 | 67µs | 67µs | Moose::Meta::Role::Application::RoleSummation::check_required_attributes |
| 1 | 1 | 1 | 46µs | 3.17ms | Moose::Meta::Role::Application::RoleSummation::BEGIN@5 |
| 1 | 1 | 1 | 43µs | 214µs | Moose::Meta::Role::Application::RoleSummation::BEGIN@7 |
| 1 | 1 | 1 | 41µs | 110µs | Moose::Meta::Role::Application::RoleSummation::BEGIN@4 |
| 1 | 1 | 1 | 41µs | 288µs | Moose::Meta::Role::Application::RoleSummation::BEGIN@15 |
| 1 | 1 | 1 | 26µs | 26µs | Moose::Meta::Role::Application::RoleSummation::BEGIN@9 |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::RoleSummation::__ANON__[:19] |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::RoleSummation::is_method_aliased |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::RoleSummation::is_method_excluded |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Meta::Role::Application::RoleSummation; | ||||
| 2 | |||||
| 3 | 3 | 107µs | 2 | 112µs | # spent 95µs (78+17) within Moose::Meta::Role::Application::RoleSummation::BEGIN@3 which was called:
# once (78µs+17µs) by Moose::BEGIN@30 at line 3 # spent 95µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@3
# spent 17µs making 1 call to strict::import |
| 4 | 3 | 95µs | 2 | 180µs | # spent 110µs (41+69) within Moose::Meta::Role::Application::RoleSummation::BEGIN@4 which was called:
# once (41µs+69µs) by Moose::BEGIN@30 at line 4 # spent 110µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@4
# spent 69µs making 1 call to warnings::import |
| 5 | 3 | 159µs | 2 | 6.30ms | # spent 3.17ms (46µs+3.13) within Moose::Meta::Role::Application::RoleSummation::BEGIN@5 which was called:
# once (46µs+3.13ms) by Moose::BEGIN@30 at line 5 # spent 3.17ms making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@5
# spent 3.13ms making 1 call to metaclass::import |
| 6 | |||||
| 7 | 3 | 113µs | 2 | 384µs | # spent 214µs (43+171) within Moose::Meta::Role::Application::RoleSummation::BEGIN@7 which was called:
# once (43µs+171µs) by Moose::BEGIN@30 at line 7 # spent 214µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@7
# spent 171µs making 1 call to Exporter::import |
| 8 | |||||
| 9 | 3 | 229µs | 1 | 26µs | # spent 26µs within Moose::Meta::Role::Application::RoleSummation::BEGIN@9 which was called:
# once (26µs+0s) by Moose::BEGIN@30 at line 9 # spent 26µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@9 |
| 10 | |||||
| 11 | 1 | 5µs | our $VERSION = '1.19'; | ||
| 12 | 1 | 65µs | $VERSION = eval $VERSION; # spent 11µs executing statements in string eval | ||
| 13 | 1 | 3µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 14 | |||||
| 15 | 3 | 4.55ms | 2 | 535µs | # spent 288µs (41+247) within Moose::Meta::Role::Application::RoleSummation::BEGIN@15 which was called:
# once (41µs+247µs) by Moose::BEGIN@30 at line 15 # spent 288µs making 1 call to Moose::Meta::Role::Application::RoleSummation::BEGIN@15
# spent 247µs making 1 call to base::import |
| 16 | |||||
| 17 | __PACKAGE__->meta->add_attribute('role_params' => ( | ||||
| 18 | reader => 'role_params', | ||||
| 19 | default => sub { {} } | ||||
| 20 | 1 | 34µs | 2 | 2.29ms | )); # spent 2.17ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 123µs making 1 call to Moose::Meta::Role::Application::RoleSummation::meta |
| 21 | |||||
| 22 | # spent 2.89ms (1.90+994µs) within Moose::Meta::Role::Application::RoleSummation::get_exclusions_for_role which was called 20 times, avg 145µs/call:
# 20 times (1.90ms+994µs) by Moose::Meta::Role::Application::RoleSummation::apply_methods at line 158, avg 145µs/call | ||||
| 23 | 20 | 73µs | my ($self, $role) = @_; | ||
| 24 | 20 | 601µs | 40 | 193µs | $role = $role->name if blessed $role; # spent 103µs making 20 calls to Scalar::Util::blessed, avg 5µs/call
# spent 90µs making 20 calls to Class::MOP::Package::name, avg 5µs/call |
| 25 | 20 | 242µs | 20 | 203µs | my $excludes_key = exists $self->role_params->{$role}->{'-excludes'} ? # spent 203µs making 20 calls to Moose::Meta::Role::Application::RoleSummation::role_params, avg 10µs/call |
| 26 | '-excludes' : 'excludes'; | ||||
| 27 | 20 | 397µs | 40 | 399µs | if ($self->role_params->{$role} && defined $self->role_params->{$role}->{$excludes_key}) { # spent 399µs making 40 calls to Moose::Meta::Role::Application::RoleSummation::role_params, avg 10µs/call |
| 28 | 10 | 359µs | 20 | 199µs | if (ref $self->role_params->{$role}->{$excludes_key} eq 'ARRAY') { # spent 199µs making 20 calls to Moose::Meta::Role::Application::RoleSummation::role_params, avg 10µs/call |
| 29 | return $self->role_params->{$role}->{$excludes_key}; | ||||
| 30 | } | ||||
| 31 | return [ $self->role_params->{$role}->{$excludes_key} ]; | ||||
| 32 | } | ||||
| 33 | 10 | 138µs | return []; | ||
| 34 | } | ||||
| 35 | |||||
| 36 | # spent 4.92ms (3.24+1.68) within Moose::Meta::Role::Application::RoleSummation::get_method_aliases_for_role which was called 43 times, avg 114µs/call:
# 23 times (1.55ms+819µs) by Moose::Meta::Role::Application::RoleSummation::is_aliased_method at line 62, avg 103µs/call
# 20 times (1.69ms+858µs) by Moose::Meta::Role::Application::RoleSummation::apply_methods at line 157, avg 127µs/call | ||||
| 37 | 43 | 151µs | my ($self, $role) = @_; | ||
| 38 | 43 | 991µs | 63 | 311µs | $role = $role->name if blessed $role; # spent 206µs making 43 calls to Scalar::Util::blessed, avg 5µs/call
# spent 105µs making 20 calls to Class::MOP::Package::name, avg 5µs/call |
| 39 | 43 | 592µs | 43 | 503µs | my $alias_key = exists $self->role_params->{$role}->{'-alias'} ? # spent 503µs making 43 calls to Moose::Meta::Role::Application::RoleSummation::role_params, avg 12µs/call |
| 40 | '-alias' : 'alias'; | ||||
| 41 | 43 | 867µs | 86 | 863µs | if ($self->role_params->{$role} && defined $self->role_params->{$role}->{$alias_key}) { # spent 863µs making 86 calls to Moose::Meta::Role::Application::RoleSummation::role_params, avg 10µs/call |
| 42 | return $self->role_params->{$role}->{$alias_key}; | ||||
| 43 | } | ||||
| 44 | 43 | 582µs | return {}; | ||
| 45 | } | ||||
| 46 | |||||
| 47 | sub is_method_excluded { | ||||
| 48 | my ($self, $role, $method_name) = @_; | ||||
| 49 | foreach ($self->get_exclusions_for_role($role->name)) { | ||||
| 50 | return 1 if $_ eq $method_name; | ||||
| 51 | } | ||||
| 52 | return 0; | ||||
| 53 | } | ||||
| 54 | |||||
| 55 | sub is_method_aliased { | ||||
| 56 | my ($self, $role, $method_name) = @_; | ||||
| 57 | exists $self->get_method_aliases_for_role($role->name)->{$method_name} ? 1 : 0 | ||||
| 58 | } | ||||
| 59 | |||||
| 60 | # spent 3.45ms (966µs+2.48) within Moose::Meta::Role::Application::RoleSummation::is_aliased_method which was called 23 times, avg 150µs/call:
# 23 times (966µs+2.48ms) by Moose::Meta::Role::Application::RoleSummation::check_required_methods at line 103, avg 150µs/call | ||||
| 61 | 23 | 93µs | my ($self, $role, $method_name) = @_; | ||
| 62 | 23 | 653µs | 46 | 2.48ms | my %aliased_names = reverse %{$self->get_method_aliases_for_role($role->name)}; # spent 2.37ms making 23 calls to Moose::Meta::Role::Application::RoleSummation::get_method_aliases_for_role, avg 103µs/call
# spent 116µs making 23 calls to Class::MOP::Package::name, avg 5µs/call |
| 63 | 23 | 375µs | exists $aliased_names{$method_name} ? 1 : 0; | ||
| 64 | } | ||||
| 65 | |||||
| 66 | # spent 2.75ms (1.50+1.25) within Moose::Meta::Role::Application::RoleSummation::check_role_exclusions which was called 9 times, avg 305µs/call:
# 9 times (1.50ms+1.25ms) by Moose::Meta::Role::Application::apply at line 50 of Moose/Meta/Role/Application.pm, avg 305µs/call | ||||
| 67 | 9 | 31µs | my ($self, $c) = @_; | ||
| 68 | |||||
| 69 | 9 | 17µs | my %excluded_roles; | ||
| 70 | 9 | 155µs | 9 | 116µs | for my $role (@{ $c->get_roles }) { # spent 116µs making 9 calls to Moose::Meta::Role::get_roles, avg 13µs/call |
| 71 | 20 | 387µs | 20 | 122µs | my $name = $role->name; # spent 122µs making 20 calls to Class::MOP::Package::name, avg 6µs/call |
| 72 | |||||
| 73 | 20 | 378µs | 20 | 751µs | for my $excluded ($role->get_excluded_roles_list) { # spent 751µs making 20 calls to Moose::Meta::Role::get_excluded_roles_list, avg 38µs/call |
| 74 | push @{ $excluded_roles{$excluded} }, $name; | ||||
| 75 | } | ||||
| 76 | } | ||||
| 77 | |||||
| 78 | 9 | 120µs | 9 | 92µs | foreach my $role (@{$c->get_roles}) { # spent 92µs making 9 calls to Moose::Meta::Role::get_roles, avg 10µs/call |
| 79 | 20 | 190µs | foreach my $excluded (keys %excluded_roles) { | ||
| 80 | next unless $role->does_role($excluded); | ||||
| 81 | |||||
| 82 | my @excluding = @{ $excluded_roles{$excluded} }; | ||||
| 83 | |||||
| 84 | require Moose; | ||||
| 85 | Moose->throw_error(sprintf "Conflict detected: Role%s %s exclude%s role '%s'", (@excluding == 1 ? '' : 's'), join(', ', @excluding), (@excluding == 1 ? 's' : ''), $excluded); | ||||
| 86 | } | ||||
| 87 | } | ||||
| 88 | |||||
| 89 | 9 | 205µs | 9 | 165µs | $c->add_excluded_roles(keys %excluded_roles); # spent 165µs making 9 calls to Moose::Meta::Role::add_excluded_roles, avg 18µs/call |
| 90 | } | ||||
| 91 | |||||
| 92 | # spent 13.7ms (2.18+11.5) within Moose::Meta::Role::Application::RoleSummation::check_required_methods which was called 9 times, avg 1.52ms/call:
# 9 times (2.18ms+11.5ms) by Moose::Meta::Role::Application::apply at line 51 of Moose/Meta/Role/Application.pm, avg 1.52ms/call | ||||
| 93 | 9 | 30µs | my ($self, $c) = @_; | ||
| 94 | |||||
| 95 | 10 | 131µs | 10 | 148µs | my %all_required_methods = # spent 148µs making 10 calls to Moose::Meta::Role::Method::Required::name, avg 15µs/call |
| 96 | 20 | 295µs | 20 | 807µs | map { $_->name => $_ } # spent 807µs making 20 calls to Moose::Meta::Role::get_required_method_list, avg 40µs/call |
| 97 | map { $_->get_required_method_list } | ||||
| 98 | 9 | 218µs | 9 | 89µs | @{$c->get_roles}; # spent 89µs making 9 calls to Moose::Meta::Role::get_roles, avg 10µs/call |
| 99 | |||||
| 100 | 9 | 126µs | 9 | 95µs | foreach my $role (@{$c->get_roles}) { # spent 95µs making 9 calls to Moose::Meta::Role::get_roles, avg 11µs/call |
| 101 | 20 | 204µs | foreach my $required (keys %all_required_methods) { | ||
| 102 | |||||
| 103 | 24 | 575µs | 47 | 9.50ms | delete $all_required_methods{$required} # spent 6.06ms making 24 calls to Class::MOP::Mixin::HasMethods::has_method, avg 252µs/call
# spent 3.45ms making 23 calls to Moose::Meta::Role::Application::RoleSummation::is_aliased_method, avg 150µs/call |
| 104 | if $role->has_method($required) | ||||
| 105 | || $self->is_aliased_method($role, $required); | ||||
| 106 | } | ||||
| 107 | } | ||||
| 108 | |||||
| 109 | 9 | 233µs | 9 | 865µs | $c->add_required_methods(values %all_required_methods); # spent 865µs making 9 calls to Moose::Meta::Role::add_required_methods, avg 96µs/call |
| 110 | } | ||||
| 111 | |||||
| 112 | 9 | 97µs | # spent 67µs within Moose::Meta::Role::Application::RoleSummation::check_required_attributes which was called 9 times, avg 7µs/call:
# 9 times (67µs+0s) by Moose::Meta::Role::Application::apply at line 52 of Moose/Meta/Role/Application.pm, avg 7µs/call | ||
| 113 | |||||
| 114 | } | ||||
| 115 | |||||
| 116 | # spent 1.50ms (737µs+767µs) within Moose::Meta::Role::Application::RoleSummation::apply_attributes which was called 9 times, avg 167µs/call:
# 9 times (737µs+767µs) by Moose::Meta::Role::Application::apply at line 54 of Moose/Meta/Role/Application.pm, avg 167µs/call | ||||
| 117 | 9 | 30µs | my ($self, $c) = @_; | ||
| 118 | |||||
| 119 | 9 | 17µs | my @all_attributes; | ||
| 120 | |||||
| 121 | 9 | 123µs | 9 | 95µs | for my $role ( @{ $c->get_roles } ) { # spent 95µs making 9 calls to Moose::Meta::Role::get_roles, avg 11µs/call |
| 122 | push @all_attributes, | ||||
| 123 | 20 | 308µs | 20 | 672µs | map { $role->get_attribute($_) } $role->get_attribute_list; # spent 672µs making 20 calls to Class::MOP::Mixin::HasAttributes::get_attribute_list, avg 34µs/call |
| 124 | } | ||||
| 125 | |||||
| 126 | 9 | 17µs | my %seen; | ||
| 127 | 9 | 46µs | foreach my $attr (@all_attributes) { | ||
| 128 | my $name = $attr->name; | ||||
| 129 | |||||
| 130 | if ( exists $seen{$name} ) { | ||||
| 131 | next if $seen{$name}->is_same_as($attr); | ||||
| 132 | |||||
| 133 | my $role1 = $seen{$name}->associated_role->name; | ||||
| 134 | my $role2 = $attr->associated_role->name; | ||||
| 135 | |||||
| 136 | require Moose; | ||||
| 137 | Moose->throw_error( | ||||
| 138 | "We have encountered an attribute conflict with '$name' " | ||||
| 139 | . "during role composition. " | ||||
| 140 | . " This attribute is defined in both $role1 and $role2." | ||||
| 141 | . " This is fatal error and cannot be disambiguated." ); | ||||
| 142 | } | ||||
| 143 | |||||
| 144 | $seen{$name} = $attr; | ||||
| 145 | } | ||||
| 146 | |||||
| 147 | 9 | 127µs | foreach my $attr (@all_attributes) { | ||
| 148 | $c->add_attribute( $attr->clone ); | ||||
| 149 | } | ||||
| 150 | } | ||||
| 151 | |||||
| 152 | # spent 203ms (20.5+182) within Moose::Meta::Role::Application::RoleSummation::apply_methods which was called 9 times, avg 22.5ms/call:
# 9 times (20.5ms+182ms) by Moose::Meta::Role::Application::apply at line 55 of Moose/Meta/Role/Application.pm, avg 22.5ms/call | ||||
| 153 | 9 | 28µs | my ($self, $c) = @_; | ||
| 154 | |||||
| 155 | 20 | 48µs | my @all_methods = map { | ||
| 156 | my $role = $_; | ||||
| 157 | 20 | 283µs | 20 | 2.55ms | my $aliases = $self->get_method_aliases_for_role($role); # spent 2.55ms making 20 calls to Moose::Meta::Role::Application::RoleSummation::get_method_aliases_for_role, avg 127µs/call |
| 158 | 20 | 426µs | 20 | 2.89ms | my %excludes = map { $_ => undef } @{ $self->get_exclusions_for_role($role) }; # spent 2.89ms making 20 calls to Moose::Meta::Role::Application::RoleSummation::get_exclusions_for_role, avg 145µs/call |
| 159 | ( | ||||
| 160 | 236 | 3.46ms | 194 | 44.9ms | (map { # spent 44.9ms making 194 calls to Class::MOP::Mixin::HasMethods::get_method, avg 232µs/call |
| 161 | 236 | 3.92ms | 236 | 1.13ms | exists $excludes{$_} ? () : # spent 1.13ms making 236 calls to Class::MOP::Method::name, avg 5µs/call |
| 162 | +{ | ||||
| 163 | role => $role, | ||||
| 164 | name => $_, | ||||
| 165 | method => $role->get_method($_), | ||||
| 166 | } | ||||
| 167 | 256 | 5.31ms | 256 | 2.03ms | } map { $_->name } # spent 2.03ms making 256 calls to UNIVERSAL::isa, avg 8µs/call |
| 168 | grep { !$_->isa('Class::MOP::Method::Meta') } | ||||
| 169 | $role->_get_local_methods), | ||||
| 170 | (map { | ||||
| 171 | 20 | 2.20ms | 20 | 83.0ms | +{ # spent 83.0ms making 20 calls to Class::MOP::Mixin::HasMethods::_get_local_methods, avg 4.15ms/call |
| 172 | role => $role, | ||||
| 173 | name => $aliases->{$_}, | ||||
| 174 | method => $role->get_method($_), | ||||
| 175 | } | ||||
| 176 | } keys %$aliases) | ||||
| 177 | ); | ||||
| 178 | 9 | 644µs | 9 | 87µs | } @{$c->get_roles}; # spent 87µs making 9 calls to Moose::Meta::Role::get_roles, avg 10µs/call |
| 179 | |||||
| 180 | 9 | 27µs | my (%seen, %method_map); | ||
| 181 | 9 | 60µs | foreach my $method (@all_methods) { | ||
| 182 | 194 | 543µs | my $seen = $seen{$method->{name}}; | ||
| 183 | |||||
| 184 | 194 | 358µs | if ($seen) { | ||
| 185 | 16 | 628µs | 32 | 193µs | if ($seen->{method}->body != $method->{method}->body) { # spent 193µs making 32 calls to Class::MOP::Method::body, avg 6µs/call |
| 186 | $c->add_conflicting_method( | ||||
| 187 | name => $method->{name}, | ||||
| 188 | roles => [$method->{role}->name, $seen->{role}->name], | ||||
| 189 | ); | ||||
| 190 | |||||
| 191 | delete $method_map{$method->{name}}; | ||||
| 192 | next; | ||||
| 193 | } | ||||
| 194 | } | ||||
| 195 | |||||
| 196 | 194 | 684µs | $seen{$method->{name}} = $method; | ||
| 197 | 194 | 1.08ms | $method_map{$method->{name}} = $method->{method}; | ||
| 198 | } | ||||
| 199 | |||||
| 200 | 18 | 3.07ms | 178 | 45.2ms | $c->add_method($_ => $method_map{$_}) for keys %method_map; # spent 45.2ms making 178 calls to Moose::Meta::Role::Composite::add_method, avg 254µs/call |
| 201 | } | ||||
| 202 | |||||
| 203 | # spent 11.5ms (3.70+7.80) within Moose::Meta::Role::Application::RoleSummation::apply_override_method_modifiers which was called 9 times, avg 1.28ms/call:
# 9 times (3.70ms+7.80ms) by Moose::Meta::Role::Application::apply at line 57 of Moose/Meta/Role/Application.pm, avg 1.28ms/call | ||||
| 204 | 9 | 32µs | my ($self, $c) = @_; | ||
| 205 | |||||
| 206 | 20 | 46µs | my @all_overrides = map { | ||
| 207 | my $role = $_; | ||||
| 208 | 41 | 664µs | 41 | 1.53ms | map { # spent 1.53ms making 41 calls to Moose::Meta::Role::get_override_method_modifier, avg 37µs/call |
| 209 | 20 | 353µs | 20 | 937µs | +{ # spent 937µs making 20 calls to Moose::Meta::Role::get_method_modifier_list, avg 47µs/call |
| 210 | name => $_, | ||||
| 211 | method => $role->get_override_method_modifier($_), | ||||
| 212 | } | ||||
| 213 | } $role->get_method_modifier_list('override'); | ||||
| 214 | 9 | 231µs | 9 | 117µs | } @{$c->get_roles}; # spent 117µs making 9 calls to Moose::Meta::Role::get_roles, avg 13µs/call |
| 215 | |||||
| 216 | 9 | 19µs | my %seen; | ||
| 217 | 9 | 59µs | foreach my $override (@all_overrides) { | ||
| 218 | 41 | 505µs | 41 | 1.56ms | if ( $c->has_method($override->{name}) ){ # spent 1.56ms making 41 calls to Moose::Meta::Role::Composite::has_method, avg 38µs/call |
| 219 | require Moose; | ||||
| 220 | Moose->throw_error( "Role '" . $c->name . "' has encountered an 'override' method conflict " . | ||||
| 221 | "during composition (A local method of the same name as been found). This " . | ||||
| 222 | "is fatal error." ) | ||||
| 223 | } | ||||
| 224 | 41 | 156µs | if (exists $seen{$override->{name}}) { | ||
| 225 | 9 | 32µs | if ( $seen{$override->{name}} != $override->{method} ) { | ||
| 226 | require Moose; | ||||
| 227 | Moose->throw_error( "We have encountered an 'override' method conflict during " . | ||||
| 228 | "composition (Two 'override' methods of the same name encountered). " . | ||||
| 229 | "This is fatal error.") | ||||
| 230 | } | ||||
| 231 | } | ||||
| 232 | 41 | 295µs | $seen{$override->{name}} = $override->{method}; | ||
| 233 | } | ||||
| 234 | |||||
| 235 | $c->add_override_method_modifier( | ||||
| 236 | $_->{name}, $_->{method} | ||||
| 237 | 18 | 861µs | 41 | 3.66ms | ) for @all_overrides; # spent 3.66ms making 41 calls to Moose::Meta::Role::add_override_method_modifier, avg 89µs/call |
| 238 | |||||
| 239 | } | ||||
| 240 | |||||
| 241 | # spent 13.7ms (4.14+9.60) within Moose::Meta::Role::Application::RoleSummation::apply_method_modifiers which was called 27 times, avg 509µs/call:
# 9 times (2.63ms+7.72ms) by Moose::Meta::Role::Application::apply_around_method_modifiers at line 74 of Moose/Meta/Role/Application.pm, avg 1.15ms/call
# 9 times (767µs+937µs) by Moose::Meta::Role::Application::apply_before_method_modifiers at line 73 of Moose/Meta/Role/Application.pm, avg 189µs/call
# 9 times (739µs+950µs) by Moose::Meta::Role::Application::apply_after_method_modifiers at line 75 of Moose/Meta/Role/Application.pm, avg 188µs/call | ||||
| 242 | 27 | 99µs | my ($self, $modifier_type, $c) = @_; | ||
| 243 | 27 | 98µs | my $add = "add_${modifier_type}_method_modifier"; | ||
| 244 | 27 | 80µs | my $get = "get_${modifier_type}_method_modifiers"; | ||
| 245 | 27 | 625µs | 27 | 292µs | foreach my $role (@{$c->get_roles}) { # spent 292µs making 27 calls to Moose::Meta::Role::get_roles, avg 11µs/call |
| 246 | 60 | 1.13ms | 60 | 2.54ms | foreach my $method_name ($role->get_method_modifier_list($modifier_type)) { # spent 2.54ms making 60 calls to Moose::Meta::Role::get_method_modifier_list, avg 42µs/call |
| 247 | $c->$add( | ||||
| 248 | $method_name, | ||||
| 249 | $_ | ||||
| 250 | 90 | 1.66ms | 92 | 6.77ms | ) foreach $role->$get($method_name); # spent 4.78ms making 47 calls to Moose::Meta::Role::add_around_method_modifier, avg 102µs/call
# spent 1.99ms making 45 calls to Moose::Meta::Role::get_around_method_modifiers, avg 44µs/call |
| 251 | } | ||||
| 252 | } | ||||
| 253 | } | ||||
| 254 | |||||
| 255 | 1 | 28µs | 1; | ||
| 256 | |||||
| 257 | __END__ |