Filename | /Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Meta/Role/Application.pm |
Statements | Executed 130 statements in 1.16ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4 | 1 | 1 | 158µs | 40.3ms | apply | Moose::Meta::Role::Application::
7 | 1 | 1 | 45µs | 62µs | is_method_excluded | Moose::Meta::Role::Application::
4 | 1 | 1 | 36µs | 168µs | apply_overloading | Moose::Meta::Role::Application::
6 | 1 | 1 | 33µs | 48µs | is_method_aliased | Moose::Meta::Role::Application::
4 | 1 | 1 | 31µs | 148µs | new | Moose::Meta::Role::Application::
1 | 1 | 1 | 29µs | 109µs | BEGIN@9 | Moose::Meta::Role::Application::
4 | 1 | 1 | 21µs | 84µs | apply_before_method_modifiers | Moose::Meta::Role::Application::
1 | 1 | 1 | 17µs | 36µs | BEGIN@4 | Moose::Meta::Role::Application::
4 | 1 | 1 | 15µs | 62µs | apply_after_method_modifiers | Moose::Meta::Role::Application::
4 | 1 | 1 | 13µs | 62µs | apply_around_method_modifiers | Moose::Meta::Role::Application::
1 | 1 | 1 | 11µs | 589µs | BEGIN@6 | Moose::Meta::Role::Application::
1 | 1 | 1 | 10µs | 221µs | BEGIN@11 | Moose::Meta::Role::Application::
4 | 1 | 1 | 10µs | 10µs | __ANON__[:23] | Moose::Meta::Role::Application::
1 | 1 | 1 | 10µs | 17µs | BEGIN@5 | Moose::Meta::Role::Application::
4 | 1 | 1 | 8µs | 8µs | __ANON__[:16] | Moose::Meta::Role::Application::
1 | 1 | 1 | 4µs | 4µs | BEGIN@7 | 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::
0 | 0 | 0 | 0s | 0s | is_aliased_method | Moose::Meta::Role::Application::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Meta::Role::Application; | ||||
2 | 1 | 800ns | our $VERSION = '2.1403'; | ||
3 | |||||
4 | 2 | 27µs | 2 | 55µs | # spent 36µs (17+19) within Moose::Meta::Role::Application::BEGIN@4 which was called:
# once (17µs+19µs) by Moose::BEGIN@34 at line 4 # spent 36µs making 1 call to Moose::Meta::Role::Application::BEGIN@4
# spent 19µs making 1 call to strict::import |
5 | 2 | 23µs | 2 | 25µs | # spent 17µs (10+7) within Moose::Meta::Role::Application::BEGIN@5 which was called:
# once (10µs+7µs) by Moose::BEGIN@34 at line 5 # spent 17µs making 1 call to Moose::Meta::Role::Application::BEGIN@5
# spent 8µs making 1 call to warnings::import |
6 | 2 | 29µs | 2 | 1.17ms | # spent 589µs (11+578) within Moose::Meta::Role::Application::BEGIN@6 which was called:
# once (11µs+578µs) by Moose::BEGIN@34 at line 6 # spent 589µs making 1 call to Moose::Meta::Role::Application::BEGIN@6
# spent 578µs making 1 call to metaclass::import |
7 | 2 | 40µs | 1 | 4µs | # spent 4µs within Moose::Meta::Role::Application::BEGIN@7 which was called:
# once (4µs+0s) by Moose::BEGIN@34 at line 7 # spent 4µs making 1 call to Moose::Meta::Role::Application::BEGIN@7 |
8 | |||||
9 | 3 | 87µs | 3 | 158µs | # spent 109µs (29+81) within Moose::Meta::Role::Application::BEGIN@9 which was called:
# once (29µs+81µs) by Moose::BEGIN@34 at line 9 # spent 109µs making 1 call to Moose::Meta::Role::Application::BEGIN@9
# spent 37µs making 1 call to UNIVERSAL::VERSION
# spent 11µs making 1 call to List::Util::import |
10 | |||||
11 | 2 | 618µs | 2 | 432µs | # spent 221µs (10+211) within Moose::Meta::Role::Application::BEGIN@11 which was called:
# once (10µs+211µs) by Moose::BEGIN@34 at line 11 # spent 221µs making 1 call to Moose::Meta::Role::Application::BEGIN@11
# spent 211µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] |
12 | |||||
13 | __PACKAGE__->meta->add_attribute('method_exclusions' => ( | ||||
14 | init_arg => '-excludes', | ||||
15 | reader => 'get_method_exclusions', | ||||
16 | 4 | 12µs | # spent 8µs within Moose::Meta::Role::Application::__ANON__[/Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Meta/Role/Application.pm:16] which was called 4 times, avg 2µs/call:
# 4 times (8µs+0s) by Moose::Meta::Role::Application::ToClass::_new at line 24 of (eval 25)[Eval/Closure.pm:125], avg 2µs/call | ||
17 | 1 | 8µs | 3 | 448µs | Class::MOP::_definition_context(), # spent 419µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 22µs making 1 call to Moose::Meta::Role::Application::meta
# spent 7µs making 1 call to Class::MOP::_definition_context |
18 | )); | ||||
19 | |||||
20 | __PACKAGE__->meta->add_attribute('method_aliases' => ( | ||||
21 | init_arg => '-alias', | ||||
22 | reader => 'get_method_aliases', | ||||
23 | 4 | 12µs | # spent 10µs within Moose::Meta::Role::Application::__ANON__[/Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Meta/Role/Application.pm:23] which was called 4 times, avg 3µs/call:
# 4 times (10µs+0s) by Moose::Meta::Role::Application::ToClass::_new at line 18 of (eval 25)[Eval/Closure.pm:125], avg 3µs/call | ||
24 | 1 | 6µs | 3 | 339µs | Class::MOP::_definition_context(), # spent 323µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 11µs making 1 call to Moose::Meta::Role::Application::meta
# spent 5µs making 1 call to Class::MOP::_definition_context |
25 | )); | ||||
26 | |||||
27 | # spent 148µs (31+117) within Moose::Meta::Role::Application::new which was called 4 times, avg 37µs/call:
# 4 times (31µs+117µs) by Moose::Meta::Role::apply at line 472 of Moose/Meta/Role.pm, avg 37µs/call | ||||
28 | 8 | 28µs | my ($class, %params) = @_; | ||
29 | 4 | 117µs | $class->_new(\%params); # spent 117µs making 4 calls to Moose::Meta::Role::Application::ToClass::_new, avg 29µs/call | ||
30 | } | ||||
31 | |||||
32 | # spent 62µs (45+17) within Moose::Meta::Role::Application::is_method_excluded which was called 7 times, avg 9µs/call:
# 7 times (45µs+17µs) by Moose::Meta::Role::Application::ToClass::apply_methods at line 141 of Moose/Meta/Role/Application/ToClass.pm, avg 9µs/call | ||||
33 | 21 | 42µs | my ($self, $method_name) = @_; | ||
34 | 7 | 17µs | foreach (@{$self->get_method_exclusions}) { # spent 17µs making 7 calls to Moose::Meta::Role::Application::get_method_exclusions, avg 2µs/call | ||
35 | return 1 if $_ eq $method_name; | ||||
36 | } | ||||
37 | return 0; | ||||
38 | } | ||||
39 | |||||
40 | # spent 48µs (33+15) within Moose::Meta::Role::Application::is_method_aliased which was called 6 times, avg 8µs/call:
# 6 times (33µs+15µs) by Moose::Meta::Role::Application::ToClass::apply_methods at line 153 of Moose/Meta/Role/Application/ToClass.pm, avg 8µs/call | ||||
41 | 12 | 31µs | my ($self, $method_name) = @_; | ||
42 | 6 | 15µs | exists $self->get_method_aliases->{$method_name} ? 1 : 0 # spent 15µs making 6 calls to Moose::Meta::Role::Application::get_method_aliases, avg 3µs/call | ||
43 | } | ||||
44 | |||||
45 | sub is_aliased_method { | ||||
46 | my ($self, $method_name) = @_; | ||||
47 | my %aliased_names = reverse %{$self->get_method_aliases}; | ||||
48 | exists $aliased_names{$method_name} ? 1 : 0; | ||||
49 | } | ||||
50 | |||||
51 | # spent 40.3ms (158µs+40.2) within Moose::Meta::Role::Application::apply which was called 4 times, avg 10.1ms/call:
# 4 times (158µs+40.2ms) by Moose::Meta::Role::Application::ToClass::apply at line 31 of Moose/Meta/Role/Application/ToClass.pm, avg 10.1ms/call | ||||
52 | 44 | 119µs | my $self = shift; | ||
53 | |||||
54 | 4 | 727µs | $self->check_role_exclusions(@_); # spent 727µs making 4 calls to Moose::Meta::Role::Application::ToClass::check_role_exclusions, avg 182µs/call | ||
55 | 4 | 68µs | $self->check_required_methods(@_); # spent 68µs making 4 calls to Moose::Meta::Role::Application::ToClass::check_required_methods, avg 17µs/call | ||
56 | 4 | 6µs | $self->check_required_attributes(@_); # spent 6µs making 4 calls to Moose::Meta::Role::Application::ToClass::check_required_attributes, avg 2µs/call | ||
57 | |||||
58 | 4 | 168µs | $self->apply_overloading(@_); # spent 168µs making 4 calls to Moose::Meta::Role::Application::apply_overloading, avg 42µs/call | ||
59 | 4 | 35.2ms | $self->apply_attributes(@_); # spent 35.2ms making 4 calls to Moose::Meta::Role::Application::ToClass::apply_attributes, avg 8.81ms/call | ||
60 | 4 | 3.70ms | $self->apply_methods(@_); # spent 3.70ms making 4 calls to Moose::Meta::Role::Application::ToClass::apply_methods, avg 926µs/call | ||
61 | |||||
62 | 4 | 68µs | $self->apply_override_method_modifiers(@_); # spent 68µs making 4 calls to Moose::Meta::Role::Application::ToClass::apply_override_method_modifiers, avg 17µs/call | ||
63 | |||||
64 | 4 | 84µs | $self->apply_before_method_modifiers(@_); # spent 84µs making 4 calls to Moose::Meta::Role::Application::apply_before_method_modifiers, avg 21µs/call | ||
65 | 4 | 62µs | $self->apply_around_method_modifiers(@_); # spent 62µs making 4 calls to Moose::Meta::Role::Application::apply_around_method_modifiers, avg 15µs/call | ||
66 | 4 | 62µs | $self->apply_after_method_modifiers(@_); # spent 62µs making 4 calls to Moose::Meta::Role::Application::apply_after_method_modifiers, avg 16µs/call | ||
67 | } | ||||
68 | |||||
69 | sub check_role_exclusions { throw_exception( "CannotCallAnAbstractMethod" ); } | ||||
70 | sub check_required_methods { throw_exception( "CannotCallAnAbstractMethod" ); } | ||||
71 | sub check_required_attributes { throw_exception( "CannotCallAnAbstractMethod" ); } | ||||
72 | |||||
73 | sub apply_attributes { throw_exception( "CannotCallAnAbstractMethod" ); } | ||||
74 | sub apply_methods { throw_exception( "CannotCallAnAbstractMethod" ); } | ||||
75 | sub apply_override_method_modifiers { throw_exception( "CannotCallAnAbstractMethod" ); } | ||||
76 | sub apply_method_modifiers { throw_exception( "CannotCallAnAbstractMethod" ); } | ||||
77 | |||||
78 | 4 | 18µs | 4 | 63µs | # spent 84µs (21+63) within Moose::Meta::Role::Application::apply_before_method_modifiers which was called 4 times, avg 21µs/call:
# 4 times (21µs+63µs) by Moose::Meta::Role::Application::apply at line 64, avg 21µs/call # spent 63µs making 4 calls to Moose::Meta::Role::Application::ToClass::apply_method_modifiers, avg 16µs/call |
79 | 4 | 12µs | 4 | 49µs | # spent 62µs (13+49) within Moose::Meta::Role::Application::apply_around_method_modifiers which was called 4 times, avg 15µs/call:
# 4 times (13µs+49µs) by Moose::Meta::Role::Application::apply at line 65, avg 15µs/call # spent 49µs making 4 calls to Moose::Meta::Role::Application::ToClass::apply_method_modifiers, avg 12µs/call |
80 | 4 | 12µs | 4 | 47µs | # spent 62µs (15+47) within Moose::Meta::Role::Application::apply_after_method_modifiers which was called 4 times, avg 16µs/call:
# 4 times (15µs+47µs) by Moose::Meta::Role::Application::apply at line 66, avg 16µs/call # spent 47µs making 4 calls to Moose::Meta::Role::Application::ToClass::apply_method_modifiers, avg 12µs/call |
81 | |||||
82 | # spent 168µs (36+133) within Moose::Meta::Role::Application::apply_overloading which was called 4 times, avg 42µs/call:
# 4 times (36µs+133µs) by Moose::Meta::Role::Application::apply at line 58, avg 42µs/call | ||||
83 | 8 | 26µs | my ( $self, $role, $other ) = @_; | ||
84 | |||||
85 | 4 | 133µs | return unless $role->is_overloaded; # spent 133µs making 4 calls to Class::MOP::Mixin::HasOverloads::is_overloaded, avg 33µs/call | ||
86 | |||||
87 | unless ( $other->is_overloaded ) { | ||||
88 | $other->set_overload_fallback_value( | ||||
89 | $role->get_overload_fallback_value ); | ||||
90 | } | ||||
91 | |||||
92 | for my $overload ( $role->get_all_overloaded_operators ) { | ||||
93 | next if $other->has_overloaded_operator( $overload->operator ); | ||||
94 | $other->add_overloaded_operator( | ||||
95 | $overload->operator => $overload->clone ); | ||||
96 | } | ||||
97 | } | ||||
98 | |||||
99 | 1 | 12µs | 1; | ||
100 | |||||
101 | # ABSTRACT: A base class for role application | ||||
102 | |||||
103 | __END__ |