File | /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/Role/Application.pm |
Statements Executed | 1250 |
Statement Execution Time | 2.87ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
26 | 2 | 2 | 860µs | 137ms | apply | Moose::Meta::Role::Application::
137 | 2 | 2 | 697µs | 898µs | is_method_excluded | Moose::Meta::Role::Application::
137 | 2 | 2 | 578µs | 798µs | is_method_aliased | Moose::Meta::Role::Application::
26 | 1 | 1 | 200µs | 710µs | new | Moose::Meta::Role::Application::
26 | 1 | 1 | 114µs | 3.91ms | apply_before_method_modifiers | Moose::Meta::Role::Application::
26 | 1 | 1 | 99µs | 5.16ms | apply_after_method_modifiers | Moose::Meta::Role::Application::
26 | 1 | 1 | 95µs | 3.60ms | apply_around_method_modifiers | Moose::Meta::Role::Application::
10 | 1 | 1 | 63µs | 81µs | is_aliased_method | Moose::Meta::Role::Application::
26 | 2 | 2 | 49µs | 49µs | __ANON__[:14] | Moose::Meta::Role::Application::
26 | 2 | 2 | 47µs | 47µs | __ANON__[:20] | Moose::Meta::Role::Application::
1 | 1 | 1 | 14µs | 17µs | BEGIN@3 | Moose::Meta::Role::Application::
1 | 1 | 1 | 8µs | 108µs | BEGIN@5 | Moose::Meta::Role::Application::
1 | 1 | 1 | 7µs | 16µs | BEGIN@4 | Moose::Meta::Role::Application::
0 | 0 | 0 | 0s | 0s | apply_attributes | Moose::Meta::Role::Application::
0 | 0 | 0 | 0s | 0s | apply_method_modifiers | Moose::Meta::Role::Application::
0 | 0 | 0 | 0s | 0s | apply_methods | Moose::Meta::Role::Application::
0 | 0 | 0 | 0s | 0s | apply_override_method_modifiers | Moose::Meta::Role::Application::
0 | 0 | 0 | 0s | 0s | check_required_attributes | Moose::Meta::Role::Application::
0 | 0 | 0 | 0s | 0s | check_required_methods | Moose::Meta::Role::Application::
0 | 0 | 0 | 0s | 0s | check_role_exclusions | Moose::Meta::Role::Application::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Meta::Role::Application; | ||||
2 | |||||
3 | 3 | 21µs | 2 | 20µs | # spent 17µs (14+3) within Moose::Meta::Role::Application::BEGIN@3 which was called
# once (14µs+3µs) by Moose::BEGIN@28 at line 3 # spent 17µs making 1 call to Moose::Meta::Role::Application::BEGIN@3
# spent 3µs making 1 call to strict::import |
4 | 3 | 18µs | 2 | 25µs | # spent 16µs (7+9) within Moose::Meta::Role::Application::BEGIN@4 which was called
# once (7µs+9µs) by Moose::BEGIN@28 at line 4 # spent 16µs making 1 call to Moose::Meta::Role::Application::BEGIN@4
# spent 9µs making 1 call to warnings::import |
5 | 3 | 461µs | 2 | 209µs | # spent 108µs (8+101) within Moose::Meta::Role::Application::BEGIN@5 which was called
# once (8µs+101µs) by Moose::BEGIN@28 at line 5 # spent 108µs making 1 call to Moose::Meta::Role::Application::BEGIN@5
# spent 101µs making 1 call to metaclass::import |
6 | |||||
7 | 1 | 600ns | our $VERSION = '0.98'; | ||
8 | 1 | 20µs | $VERSION = eval $VERSION; | ||
9 | 1 | 400ns | our $AUTHORITY = 'cpan:STEVAN'; | ||
10 | |||||
11 | __PACKAGE__->meta->add_attribute('method_exclusions' => ( | ||||
12 | init_arg => '-excludes', | ||||
13 | reader => 'get_method_exclusions', | ||||
14 | 26 | 76µs | # spent 49µs within Moose::Meta::Role::Application::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/Role/Application.pm:14] which was called 26 times, avg 2µs/call:
# 13 times (30µ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 2µs/call
# 13 times (19µ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 1µs/call | ||
15 | 1 | 7µs | 2 | 294µs | )); # spent 277µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 17µ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 | 26 | 70µs | # spent 47µs within Moose::Meta::Role::Application::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/Role/Application.pm:20] which was called 26 times, avg 2µs/call:
# 13 times (28µ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 2µs/call
# 13 times (19µ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 1µs/call | ||
21 | 1 | 4µs | 2 | 283µs | )); # spent 272µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Moose::Meta::Role::Application::meta |
22 | |||||
23 | # spent 710µs (200+510) within Moose::Meta::Role::Application::new which was called 26 times, avg 27µs/call:
# 26 times (200µs+510µs) by Moose::Meta::Role::apply at line 419 of Moose/Meta/Role.pm, avg 27µs/call | ||||
24 | 130 | 179µs | my ($class, %params) = @_; | ||
25 | |||||
26 | if ( exists $params{excludes} && !exists $params{'-excludes'} ) { | ||||
27 | $params{'-excludes'} = delete $params{excludes}; | ||||
28 | } | ||||
29 | if ( exists $params{alias} && !exists $params{'-alias'} ) { | ||||
30 | $params{'-alias'} = delete $params{alias}; | ||||
31 | } | ||||
32 | |||||
33 | 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 | $class->_new(\%params); # spent 309µs making 13 calls to Moose::Meta::Role::Application::ToClass::_new, avg 24µs/call
# spent 200µs making 13 calls to Moose::Meta::Role::Application::ToRole::_new, avg 15µs/call | ||||
44 | } | ||||
45 | |||||
46 | # spent 898µs (697+200) within Moose::Meta::Role::Application::is_method_excluded which was called 137 times, avg 7µs/call:
# 69 times (328µs+94µs) by Moose::Meta::Role::Application::ToRole::apply_methods at line 77 of Moose/Meta/Role/Application/ToRole.pm, avg 6µs/call
# 68 times (369µs+106µs) by Moose::Meta::Role::Application::ToClass::apply_methods at line 154 of Moose/Meta/Role/Application/ToClass.pm, avg 7µs/call | ||||
47 | 411 | 586µs | my ($self, $method_name) = @_; | ||
48 | foreach (@{$self->get_method_exclusions}) { # spent 200µs making 137 calls to Moose::Meta::Role::Application::get_method_exclusions, avg 1µs/call | ||||
49 | return 1 if $_ eq $method_name; | ||||
50 | } | ||||
51 | return 0; | ||||
52 | } | ||||
53 | |||||
54 | # spent 798µs (578+220) within Moose::Meta::Role::Application::is_method_aliased which was called 137 times, avg 6µs/call:
# 69 times (277µs+101µs) by Moose::Meta::Role::Application::ToRole::apply_methods at line 97 of Moose/Meta/Role/Application/ToRole.pm, avg 5µs/call
# 68 times (301µs+119µs) by Moose::Meta::Role::Application::ToClass::apply_methods at line 170 of Moose/Meta/Role/Application/ToClass.pm, avg 6µs/call | ||||
55 | 274 | 479µs | my ($self, $method_name) = @_; | ||
56 | exists $self->get_method_aliases->{$method_name} ? 1 : 0 # spent 220µs making 137 calls to Moose::Meta::Role::Application::get_method_aliases, avg 2µs/call | ||||
57 | } | ||||
58 | |||||
59 | # spent 81µs (63+17) within Moose::Meta::Role::Application::is_aliased_method which was called 10 times, avg 8µs/call:
# 10 times (63µs+17µs) by Moose::Meta::Role::Application::ToRole::check_required_methods at line 41 of Moose/Meta/Role/Application/ToRole.pm, avg 8µs/call | ||||
60 | 30 | 56µs | my ($self, $method_name) = @_; | ||
61 | my %aliased_names = reverse %{$self->get_method_aliases}; # spent 18µs making 10 calls to Moose::Meta::Role::Application::get_method_aliases, avg 2µs/call | ||||
62 | exists $aliased_names{$method_name} ? 1 : 0; | ||||
63 | } | ||||
64 | |||||
65 | # spent 137ms (860µs+137) within Moose::Meta::Role::Application::apply which was called 26 times, avg 5.28ms/call:
# 13 times (464µs+105ms) by Moose::Meta::Role::Application::ToClass::apply at line 31 of Moose/Meta/Role/Application/ToClass.pm, avg 8.09ms/call
# 13 times (396µs+31.9ms) by Moose::Meta::Role::Application::ToRole::apply at line 17 of Moose/Meta/Role/Application/ToRole.pm, avg 2.48ms/call | ||||
66 | 260 | 622µs | my $self = shift; | ||
67 | |||||
68 | $self->check_role_exclusions(@_); # spent 3.08ms making 13 calls to Moose::Meta::Role::Application::ToClass::check_role_exclusions, avg 237µs/call
# spent 301µs making 13 calls to Moose::Meta::Role::Application::ToRole::check_role_exclusions, avg 23µs/call | ||||
69 | $self->check_required_methods(@_); # spent 1.32ms making 13 calls to Moose::Meta::Role::Application::ToRole::check_required_methods, avg 102µs/call
# spent 401µs making 13 calls to Moose::Meta::Role::Application::ToClass::check_required_methods, avg 31µs/call | ||||
70 | $self->check_required_attributes(@_); # spent 18µs making 13 calls to Moose::Meta::Role::Application::ToClass::check_required_attributes, avg 1µs/call
# spent 13µs making 13 calls to Moose::Meta::Role::Application::ToRole::check_required_attributes, avg 985ns/call | ||||
71 | |||||
72 | $self->apply_attributes(@_); # spent 61.5ms making 13 calls to Moose::Meta::Role::Application::ToClass::apply_attributes, avg 4.73ms/call
# spent 2.63ms making 13 calls to Moose::Meta::Role::Application::ToRole::apply_attributes, avg 202µs/call | ||||
73 | $self->apply_methods(@_); # spent 28.0ms making 13 calls to Moose::Meta::Role::Application::ToClass::apply_methods, avg 2.15ms/call
# spent 26.2ms making 13 calls to Moose::Meta::Role::Application::ToRole::apply_methods, avg 2.02ms/call | ||||
74 | |||||
75 | $self->apply_override_method_modifiers(@_); # spent 250µs making 13 calls to Moose::Meta::Role::Application::ToClass::apply_override_method_modifiers, avg 19µs/call
# spent 156µs making 13 calls to Moose::Meta::Role::Application::ToRole::apply_override_method_modifiers, avg 12µs/call | ||||
76 | |||||
77 | $self->apply_before_method_modifiers(@_); # spent 3.91ms making 26 calls to Moose::Meta::Role::Application::apply_before_method_modifiers, avg 150µs/call | ||||
78 | $self->apply_around_method_modifiers(@_); # spent 3.60ms making 26 calls to Moose::Meta::Role::Application::apply_around_method_modifiers, avg 138µs/call | ||||
79 | $self->apply_after_method_modifiers(@_); # spent 5.16ms making 26 calls to Moose::Meta::Role::Application::apply_after_method_modifiers, avg 198µ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 | 26 | 103µs | 26 | 3.80ms | # spent 3.91ms (114µs+3.80) within Moose::Meta::Role::Application::apply_before_method_modifiers which was called 26 times, avg 150µs/call:
# 26 times (114µs+3.80ms) by Moose::Meta::Role::Application::apply at line 77, avg 150µs/call # spent 3.38ms making 13 calls to Moose::Meta::Role::Application::ToClass::apply_method_modifiers, avg 260µs/call
# spent 421µs making 13 calls to Moose::Meta::Role::Application::ToRole::apply_method_modifiers, avg 32µs/call |
92 | 26 | 69µs | 26 | 3.50ms | # spent 3.60ms (95µs+3.50) within Moose::Meta::Role::Application::apply_around_method_modifiers which was called 26 times, avg 138µs/call:
# 26 times (95µs+3.50ms) by Moose::Meta::Role::Application::apply at line 78, avg 138µs/call # spent 3.38ms making 13 calls to Moose::Meta::Role::Application::ToClass::apply_method_modifiers, avg 260µs/call
# spent 126µs making 13 calls to Moose::Meta::Role::Application::ToRole::apply_method_modifiers, avg 10µs/call |
93 | 26 | 84µs | 26 | 5.06ms | # spent 5.16ms (99µs+5.06) within Moose::Meta::Role::Application::apply_after_method_modifiers which was called 26 times, avg 198µs/call:
# 26 times (99µs+5.06ms) by Moose::Meta::Role::Application::apply at line 79, avg 198µs/call # spent 4.49ms making 13 calls to Moose::Meta::Role::Application::ToClass::apply_method_modifiers, avg 345µs/call
# spent 573µs making 13 calls to Moose::Meta::Role::Application::ToRole::apply_method_modifiers, avg 44µs/call |
94 | |||||
95 | 1 | 12µ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 |