| File | /usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi/Moose/Meta/Role/Application.pm |
| Statements Executed | 1806 |
| Statement Execution Time | 21.1ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 187 | 2 | 2 | 6.05ms | 8.49ms | Moose::Meta::Role::Application::is_method_excluded |
| 41 | 3 | 3 | 5.99ms | 859ms | Moose::Meta::Role::Application::apply |
| 187 | 2 | 2 | 4.90ms | 6.81ms | Moose::Meta::Role::Application::is_method_aliased |
| 41 | 2 | 2 | 1.27ms | 21.3ms | Moose::Meta::Role::Application::new |
| 41 | 1 | 1 | 900µs | 42.4ms | Moose::Meta::Role::Application::apply_around_method_modifiers |
| 41 | 1 | 1 | 788µs | 10.8ms | Moose::Meta::Role::Application::apply_after_method_modifiers |
| 41 | 1 | 1 | 717µs | 41.1ms | Moose::Meta::Role::Application::apply_before_method_modifiers |
| 12 | 1 | 1 | 431µs | 538µs | Moose::Meta::Role::Application::is_aliased_method |
| 41 | 4 | 4 | 366µs | 366µs | Moose::Meta::Role::Application::__ANON__[:14] |
| 41 | 4 | 4 | 350µs | 350µs | Moose::Meta::Role::Application::__ANON__[:20] |
| 1 | 1 | 1 | 103µs | 117µs | Moose::Meta::Role::Application::BEGIN@3 |
| 1 | 1 | 1 | 34µs | 570µs | Moose::Meta::Role::Application::BEGIN@5 |
| 1 | 1 | 1 | 33µs | 203µs | Moose::Meta::Role::Application::BEGIN@4 |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::apply_attributes |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::apply_method_modifiers |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::apply_methods |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::apply_override_method_modifiers |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::check_required_attributes |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::check_required_methods |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Role::Application::check_role_exclusions |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Meta::Role::Application; | ||||
| 2 | |||||
| 3 | 3 | 96µs | 2 | 132µs | # spent 117µs (103+15) within Moose::Meta::Role::Application::BEGIN@3 which was called
# once (103µs+15µs) by Moose::BEGIN@28 at line 3 # spent 117µs making 1 call to Moose::Meta::Role::Application::BEGIN@3
# spent 15µs making 1 call to strict::import |
| 4 | 3 | 88µs | 2 | 374µs | # spent 203µs (33+170) within Moose::Meta::Role::Application::BEGIN@4 which was called
# once (33µs+170µs) by Moose::BEGIN@28 at line 4 # spent 203µs making 1 call to Moose::Meta::Role::Application::BEGIN@4
# spent 170µs making 1 call to warnings::import |
| 5 | 3 | 2.15ms | 2 | 1.11ms | # spent 570µs (34+536) within Moose::Meta::Role::Application::BEGIN@5 which was called
# once (34µs+536µs) by Moose::BEGIN@28 at line 5 # spent 570µs making 1 call to Moose::Meta::Role::Application::BEGIN@5
# spent 536µs making 1 call to metaclass::import |
| 6 | |||||
| 7 | 1 | 3µs | our $VERSION = '1.01'; | ||
| 8 | 1 | 51µs | $VERSION = eval $VERSION; | ||
| 9 | 1 | 2µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 10 | |||||
| 11 | __PACKAGE__->meta->add_attribute('method_exclusions' => ( | ||||
| 12 | init_arg => '-excludes', | ||||
| 13 | reader => 'get_method_exclusions', | ||||
| 14 | 41 | 646µs | # spent 366µs within Moose::Meta::Role::Application::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi/Moose/Meta/Role/Application.pm:14] which was called 41 times, avg 9µs/call:
# 23 times (230µs+0s) by Moose::Meta::Role::Application::ToClass::_new at line 17 of (eval 0)[Class/MOP/Method/Generated.pm:54] at line 54 of Class/MOP/Method/Generated.pm, avg 10µs/call
# 10 times (74µs+0s) by Moose::Meta::Role::Application::ToRole::_new at line 11 of (eval 0)[Class/MOP/Method/Generated.pm:54] at line 54 of Class/MOP/Method/Generated.pm, avg 7µs/call
# 4 times (31µs+0s) by Moose::Meta::Role::Application::RoleSummation::_new at line 16 of (eval 0)[Class/MOP/Method/Generated.pm:54] at line 54 of Class/MOP/Method/Generated.pm, avg 8µs/call
# 4 times (31µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm, avg 8µs/call | ||
| 15 | 1 | 28µs | 2 | 2.44ms | )); # spent 2.26ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 177µs making 1 call to Moose::Meta::Role::Application::meta |
| 16 | |||||
| 17 | __PACKAGE__->meta->add_attribute('method_aliases' => ( | ||||
| 18 | init_arg => '-alias', | ||||
| 19 | reader => 'get_method_aliases', | ||||
| 20 | 41 | 493µs | # spent 350µs within Moose::Meta::Role::Application::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi/Moose/Meta/Role/Application.pm:20] which was called 41 times, avg 9µs/call:
# 23 times (199µs+0s) by Moose::Meta::Role::Application::ToClass::_new at line 22 of (eval 0)[Class/MOP/Method/Generated.pm:54] at line 54 of Class/MOP/Method/Generated.pm, avg 9µs/call
# 10 times (95µs+0s) by Moose::Meta::Role::Application::ToRole::_new at line 16 of (eval 0)[Class/MOP/Method/Generated.pm:54] at line 54 of Class/MOP/Method/Generated.pm, avg 10µs/call
# 4 times (29µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 53 of Class/MOP/Mixin/AttributeCore.pm, avg 7µs/call
# 4 times (27µs+0s) by Moose::Meta::Role::Application::RoleSummation::_new at line 21 of (eval 0)[Class/MOP/Method/Generated.pm:54] at line 54 of Class/MOP/Method/Generated.pm, avg 7µs/call | ||
| 21 | 1 | 21µs | 2 | 2.56ms | )); # spent 2.50ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 59µs making 1 call to Moose::Meta::Role::Application::meta |
| 22 | |||||
| 23 | # spent 21.3ms (1.27+20.1) within Moose::Meta::Role::Application::new which was called 41 times, avg 520µs/call:
# 37 times (1.14ms+19.6ms) by Moose::Meta::Role::apply at line 419 of Moose/Meta/Role.pm, avg 561µs/call
# 4 times (123µs+457µs) by Moose::Meta::Role::Composite::apply_params at line 120 of Moose/Meta/Role/Composite.pm, avg 145µs/call | ||||
| 24 | 41 | 293µs | my ($class, %params) = @_; | ||
| 25 | |||||
| 26 | 41 | 167µs | if ( exists $params{excludes} && !exists $params{'-excludes'} ) { | ||
| 27 | $params{'-excludes'} = delete $params{excludes}; | ||||
| 28 | } | ||||
| 29 | 41 | 59µs | if ( exists $params{alias} && !exists $params{'-alias'} ) { | ||
| 30 | $params{'-alias'} = delete $params{alias}; | ||||
| 31 | } | ||||
| 32 | |||||
| 33 | 41 | 60µs | if ( exists $params{'-excludes'} ) { | ||
| 34 | |||||
| 35 | # I wish we had coercion here :) | ||||
| 36 | $params{'-excludes'} = ( | ||||
| 37 | ref $params{'-excludes'} eq 'ARRAY' | ||||
| 38 | ? $params{'-excludes'} | ||||
| 39 | : [ $params{'-excludes'} ] | ||||
| 40 | ); | ||||
| 41 | } | ||||
| 42 | |||||
| 43 | 41 | 776µs | 41 | 20.1ms | $class->_new(\%params); # spent 13.6ms making 26 calls to Moose::Meta::Role::Application::ToClass::_new, avg 523µs/call
# spent 6.02ms making 11 calls to Moose::Meta::Role::Application::ToRole::_new, avg 547µs/call
# spent 457µs making 4 calls to Moose::Meta::Role::Application::RoleSummation::_new, avg 114µs/call |
| 44 | } | ||||
| 45 | |||||
| 46 | # spent 8.49ms (6.05+2.44) within Moose::Meta::Role::Application::is_method_excluded which was called 187 times, avg 45µs/call:
# 166 times (4.34ms+2.26ms) by Moose::Meta::Role::Application::ToClass::apply_methods at line 154 of Moose/Meta/Role/Application/ToClass.pm, avg 40µs/call
# 21 times (1.72ms+180µs) by Moose::Meta::Role::Application::ToRole::apply_methods at line 77 of Moose/Meta/Role/Application/ToRole.pm, avg 90µs/call | ||||
| 47 | 187 | 502µs | my ($self, $method_name) = @_; | ||
| 48 | 187 | 2.14ms | 187 | 2.44ms | foreach (@{$self->get_method_exclusions}) { # spent 2.44ms making 187 calls to Moose::Meta::Role::Application::get_method_exclusions, avg 13µs/call |
| 49 | return 1 if $_ eq $method_name; | ||||
| 50 | } | ||||
| 51 | 187 | 3.16ms | return 0; | ||
| 52 | } | ||||
| 53 | |||||
| 54 | # spent 6.81ms (4.90+1.90) within Moose::Meta::Role::Application::is_method_aliased which was called 187 times, avg 36µs/call:
# 166 times (4.47ms+1.57ms) by Moose::Meta::Role::Application::ToClass::apply_methods at line 170 of Moose/Meta/Role/Application/ToClass.pm, avg 36µs/call
# 21 times (438µs+330µs) by Moose::Meta::Role::Application::ToRole::apply_methods at line 97 of Moose/Meta/Role/Application/ToRole.pm, avg 37µs/call | ||||
| 55 | 187 | 579µs | my ($self, $method_name) = @_; | ||
| 56 | 187 | 2.86ms | 187 | 1.90ms | exists $self->get_method_aliases->{$method_name} ? 1 : 0 # spent 1.90ms making 187 calls to Moose::Meta::Role::Application::get_method_aliases, avg 10µs/call |
| 57 | } | ||||
| 58 | |||||
| 59 | # spent 538µs (431+107) within Moose::Meta::Role::Application::is_aliased_method which was called 12 times, avg 45µs/call:
# 12 times (431µs+107µs) by Moose::Meta::Role::Application::ToRole::check_required_methods at line 41 of Moose/Meta/Role/Application/ToRole.pm, avg 45µs/call | ||||
| 60 | 12 | 36µs | my ($self, $method_name) = @_; | ||
| 61 | 12 | 270µs | 12 | 108µs | my %aliased_names = reverse %{$self->get_method_aliases}; # spent 108µs making 12 calls to Moose::Meta::Role::Application::get_method_aliases, avg 9µs/call |
| 62 | 12 | 107µs | exists $aliased_names{$method_name} ? 1 : 0; | ||
| 63 | } | ||||
| 64 | |||||
| 65 | # spent 859ms (5.99+853) within Moose::Meta::Role::Application::apply which was called 41 times, avg 21.0ms/call:
# 26 times (3.51ms+682ms) by Moose::Meta::Role::Application::ToClass::apply at line 31 of Moose/Meta/Role/Application/ToClass.pm, avg 26.4ms/call
# 11 times (1.47ms+95.9ms) by Moose::Meta::Role::Application::ToRole::apply at line 17 of Moose/Meta/Role/Application/ToRole.pm, avg 8.85ms/call
# 4 times (1.00ms+74.8ms) by Moose::Meta::Role::Composite::apply_params at line 120 of Moose/Meta/Role/Composite.pm, avg 19.0ms/call | ||||
| 66 | 41 | 80µs | my $self = shift; | ||
| 67 | |||||
| 68 | 41 | 326µs | 41 | 34.4ms | $self->check_role_exclusions(@_); # spent 32.0ms making 26 calls to Moose::Meta::Role::Application::ToClass::check_role_exclusions, avg 1.23ms/call
# spent 1.24ms making 4 calls to Moose::Meta::Role::Application::RoleSummation::check_role_exclusions, avg 309µs/call
# spent 1.14ms making 11 calls to Moose::Meta::Role::Application::ToRole::check_role_exclusions, avg 104µs/call |
| 69 | 41 | 340µs | 41 | 18.6ms | $self->check_required_methods(@_); # spent 6.79ms making 26 calls to Moose::Meta::Role::Application::ToClass::check_required_methods, avg 261µs/call
# spent 6.39ms making 11 calls to Moose::Meta::Role::Application::ToRole::check_required_methods, avg 581µs/call
# spent 5.45ms making 4 calls to Moose::Meta::Role::Application::RoleSummation::check_required_methods, avg 1.36ms/call |
| 70 | 41 | 435µs | 41 | 316µs | $self->check_required_attributes(@_); # spent 246µs making 26 calls to Moose::Meta::Role::Application::ToClass::check_required_attributes, avg 9µs/call
# spent 50µs making 11 calls to Moose::Meta::Role::Application::ToRole::check_required_attributes, avg 5µs/call
# spent 20µs making 4 calls to Moose::Meta::Role::Application::RoleSummation::check_required_attributes, avg 5µs/call |
| 71 | |||||
| 72 | 41 | 352µs | 41 | 105ms | $self->apply_attributes(@_); # spent 93.5ms making 26 calls to Moose::Meta::Role::Application::ToClass::apply_attributes, avg 3.60ms/call
# spent 6.43ms making 11 calls to Moose::Meta::Role::Application::ToRole::apply_attributes, avg 584µs/call
# spent 5.14ms making 4 calls to Moose::Meta::Role::Application::RoleSummation::apply_attributes, avg 1.29ms/call |
| 73 | 41 | 426µs | 41 | 595ms | $self->apply_methods(@_); # spent 388ms making 23 calls to Moose::Meta::Role::Application::ToClass::apply_methods, avg 16.9ms/call
# spent 72.9ms making 3 calls to Class::MOP::Class::__ANON__::SERIAL::3::apply_methods, avg 24.3ms/call
# spent 58.2ms making 4 calls to Moose::Meta::Role::Application::RoleSummation::apply_methods, avg 14.5ms/call
# spent 53.5ms making 10 calls to Moose::Meta::Role::Application::ToRole::apply_methods, avg 5.35ms/call
# spent 22.5ms making 1 call to Class::MOP::Class::__ANON__::SERIAL::2::apply_methods |
| 74 | |||||
| 75 | 41 | 409µs | 41 | 5.54ms | $self->apply_override_method_modifiers(@_); # spent 3.97ms making 26 calls to Moose::Meta::Role::Application::ToClass::apply_override_method_modifiers, avg 153µs/call
# spent 841µs making 4 calls to Moose::Meta::Role::Application::RoleSummation::apply_override_method_modifiers, avg 210µs/call
# spent 734µs making 11 calls to Moose::Meta::Role::Application::ToRole::apply_override_method_modifiers, avg 67µs/call |
| 76 | |||||
| 77 | 41 | 462µs | 41 | 41.1ms | $self->apply_before_method_modifiers(@_); # spent 41.1ms making 41 calls to Moose::Meta::Role::Application::apply_before_method_modifiers, avg 1.00ms/call |
| 78 | 41 | 666µs | 41 | 42.4ms | $self->apply_around_method_modifiers(@_); # spent 42.4ms making 41 calls to Moose::Meta::Role::Application::apply_around_method_modifiers, avg 1.03ms/call |
| 79 | 41 | 792µs | 41 | 10.8ms | $self->apply_after_method_modifiers(@_); # spent 10.8ms making 41 calls to Moose::Meta::Role::Application::apply_after_method_modifiers, avg 265µs/call |
| 80 | } | ||||
| 81 | |||||
| 82 | sub check_role_exclusions { Carp::croak "Abstract Method" } | ||||
| 83 | sub check_required_methods { Carp::croak "Abstract Method" } | ||||
| 84 | sub check_required_attributes { Carp::croak "Abstract Method" } | ||||
| 85 | |||||
| 86 | sub apply_attributes { Carp::croak "Abstract Method" } | ||||
| 87 | sub apply_methods { Carp::croak "Abstract Method" } | ||||
| 88 | sub apply_override_method_modifiers { Carp::croak "Abstract Method" } | ||||
| 89 | sub apply_method_modifiers { Carp::croak "Abstract Method" } | ||||
| 90 | |||||
| 91 | 41 | 737µs | 41 | 40.4ms | # spent 41.1ms (717µs+40.4) within Moose::Meta::Role::Application::apply_before_method_modifiers which was called 41 times, avg 1.00ms/call:
# 41 times (717µs+40.4ms) by Moose::Meta::Role::Application::apply at line 77, avg 1.00ms/call # spent 38.8ms making 26 calls to Moose::Meta::Role::Application::ToClass::apply_method_modifiers, avg 1.49ms/call
# spent 860µs making 4 calls to Moose::Meta::Role::Application::RoleSummation::apply_method_modifiers, avg 215µs/call
# spent 743µs making 11 calls to Moose::Meta::Role::Application::ToRole::apply_method_modifiers, avg 68µs/call |
| 92 | 41 | 765µs | 41 | 41.5ms | # spent 42.4ms (900µs+41.5) within Moose::Meta::Role::Application::apply_around_method_modifiers which was called 41 times, avg 1.03ms/call:
# 41 times (900µs+41.5ms) by Moose::Meta::Role::Application::apply at line 78, avg 1.03ms/call # spent 38.1ms making 26 calls to Moose::Meta::Role::Application::ToClass::apply_method_modifiers, avg 1.47ms/call
# spent 1.91ms making 11 calls to Moose::Meta::Role::Application::ToRole::apply_method_modifiers, avg 174µs/call
# spent 1.43ms making 4 calls to Moose::Meta::Role::Application::RoleSummation::apply_method_modifiers, avg 358µs/call |
| 93 | 41 | 711µs | 41 | 10.1ms | # spent 10.8ms (788µs+10.1) within Moose::Meta::Role::Application::apply_after_method_modifiers which was called 41 times, avg 265µs/call:
# 41 times (788µs+10.1ms) by Moose::Meta::Role::Application::apply at line 79, avg 265µs/call # spent 6.78ms making 26 calls to Moose::Meta::Role::Application::ToClass::apply_method_modifiers, avg 261µs/call
# spent 1.87ms making 11 calls to Moose::Meta::Role::Application::ToRole::apply_method_modifiers, avg 170µs/call
# spent 1.41ms making 4 calls to Moose::Meta::Role::Application::RoleSummation::apply_method_modifiers, avg 353µs/call |
| 94 | |||||
| 95 | 1 | 28µs | 1; | ||
| 96 | |||||
| 97 | __END__ | ||||
| 98 | |||||
| 99 | =pod | ||||
| 100 | |||||
| 101 | =head1 NAME | ||||
| 102 | |||||
| 103 | Moose::Meta::Role::Application - A base class for role application | ||||
| 104 | |||||
| 105 | =head1 DESCRIPTION | ||||
| 106 | |||||
| 107 | This is the abstract base class for role applications. | ||||
| 108 | |||||
| 109 | The API for this class and its subclasses still needs some | ||||
| 110 | consideration, and is intentionally not yet documented. | ||||
| 111 | |||||
| 112 | =head2 METHODS | ||||
| 113 | |||||
| 114 | =over 4 | ||||
| 115 | |||||
| 116 | =item B<new> | ||||
| 117 | |||||
| 118 | =item B<meta> | ||||
| 119 | |||||
| 120 | =item B<get_method_exclusions> | ||||
| 121 | |||||
| 122 | =item B<is_method_excluded> | ||||
| 123 | |||||
| 124 | =item B<get_method_aliases> | ||||
| 125 | |||||
| 126 | =item B<is_aliased_method> | ||||
| 127 | |||||
| 128 | =item B<is_method_aliased> | ||||
| 129 | |||||
| 130 | =item B<apply> | ||||
| 131 | |||||
| 132 | =item B<check_role_exclusions> | ||||
| 133 | |||||
| 134 | =item B<check_required_methods> | ||||
| 135 | |||||
| 136 | =item B<check_required_attributes> | ||||
| 137 | |||||
| 138 | =item B<apply_attributes> | ||||
| 139 | |||||
| 140 | =item B<apply_methods> | ||||
| 141 | |||||
| 142 | =item B<apply_method_modifiers> | ||||
| 143 | |||||
| 144 | =item B<apply_before_method_modifiers> | ||||
| 145 | |||||
| 146 | =item B<apply_after_method_modifiers> | ||||
| 147 | |||||
| 148 | =item B<apply_around_method_modifiers> | ||||
| 149 | |||||
| 150 | =item B<apply_override_method_modifiers> | ||||
| 151 | |||||
| 152 | =back | ||||
| 153 | |||||
| 154 | =head1 BUGS | ||||
| 155 | |||||
| 156 | See L<Moose/BUGS> for details on reporting bugs. | ||||
| 157 | |||||
| 158 | =head1 AUTHOR | ||||
| 159 | |||||
| 160 | Stevan Little E<lt>stevan@iinteractive.comE<gt> | ||||
| 161 | |||||
| 162 | =head1 COPYRIGHT AND LICENSE | ||||
| 163 | |||||
| 164 | Copyright 2006-2010 by Infinity Interactive, Inc. | ||||
| 165 | |||||
| 166 | L<http://www.iinteractive.com> | ||||
| 167 | |||||
| 168 | This library is free software; you can redistribute it and/or modify | ||||
| 169 | it under the same terms as Perl itself. | ||||
| 170 | |||||
| 171 | =cut | ||||
| 172 |