← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:07 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Meta/Role/Application.pm
StatementsExecuted 17 statements in 436µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11118µs407µsMoose::Meta::Role::Application::::BEGIN@6Moose::Meta::Role::Application::BEGIN@6
11112µs15µsMoose::Meta::Role::Application::::BEGIN@4Moose::Meta::Role::Application::BEGIN@4
11111µs54µsMoose::Meta::Role::Application::::BEGIN@9Moose::Meta::Role::Application::BEGIN@9
1116µs135µsMoose::Meta::Role::Application::::BEGIN@11Moose::Meta::Role::Application::BEGIN@11
1115µs13µsMoose::Meta::Role::Application::::BEGIN@5Moose::Meta::Role::Application::BEGIN@5
1112µs2µsMoose::Meta::Role::Application::::BEGIN@7Moose::Meta::Role::Application::BEGIN@7
0000s0sMoose::Meta::Role::Application::::__ANON__[:16]Moose::Meta::Role::Application::__ANON__[:16]
0000s0sMoose::Meta::Role::Application::::__ANON__[:23]Moose::Meta::Role::Application::__ANON__[:23]
0000s0sMoose::Meta::Role::Application::::applyMoose::Meta::Role::Application::apply
0000s0sMoose::Meta::Role::Application::::apply_after_method_modifiersMoose::Meta::Role::Application::apply_after_method_modifiers
0000s0sMoose::Meta::Role::Application::::apply_around_method_modifiersMoose::Meta::Role::Application::apply_around_method_modifiers
0000s0sMoose::Meta::Role::Application::::apply_attributesMoose::Meta::Role::Application::apply_attributes
0000s0sMoose::Meta::Role::Application::::apply_before_method_modifiersMoose::Meta::Role::Application::apply_before_method_modifiers
0000s0sMoose::Meta::Role::Application::::apply_method_modifiersMoose::Meta::Role::Application::apply_method_modifiers
0000s0sMoose::Meta::Role::Application::::apply_methodsMoose::Meta::Role::Application::apply_methods
0000s0sMoose::Meta::Role::Application::::apply_overloadingMoose::Meta::Role::Application::apply_overloading
0000s0sMoose::Meta::Role::Application::::apply_override_method_modifiersMoose::Meta::Role::Application::apply_override_method_modifiers
0000s0sMoose::Meta::Role::Application::::check_required_attributesMoose::Meta::Role::Application::check_required_attributes
0000s0sMoose::Meta::Role::Application::::check_required_methodsMoose::Meta::Role::Application::check_required_methods
0000s0sMoose::Meta::Role::Application::::check_role_exclusionsMoose::Meta::Role::Application::check_role_exclusions
0000s0sMoose::Meta::Role::Application::::is_aliased_methodMoose::Meta::Role::Application::is_aliased_method
0000s0sMoose::Meta::Role::Application::::is_method_aliasedMoose::Meta::Role::Application::is_method_aliased
0000s0sMoose::Meta::Role::Application::::is_method_excludedMoose::Meta::Role::Application::is_method_excluded
0000s0sMoose::Meta::Role::Application::::newMoose::Meta::Role::Application::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Meta::Role::Application;
21200nsour $VERSION = '2.1605';
3
4216µs218µs
# spent 15µs (12+3) within Moose::Meta::Role::Application::BEGIN@4 which was called: # once (12µs+3µs) by Moose::BEGIN@34 at line 4
use strict;
# spent 15µs making 1 call to Moose::Meta::Role::Application::BEGIN@4 # spent 3µs making 1 call to strict::import
5215µs221µs
# spent 13µs (5+8) within Moose::Meta::Role::Application::BEGIN@5 which was called: # once (5µs+8µs) by Moose::BEGIN@34 at line 5
use warnings;
# spent 13µs making 1 call to Moose::Meta::Role::Application::BEGIN@5 # spent 8µs making 1 call to warnings::import
6223µs2796µs
# spent 407µs (18+389) within Moose::Meta::Role::Application::BEGIN@6 which was called: # once (18µs+389µs) by Moose::BEGIN@34 at line 6
use metaclass;
# spent 407µs making 1 call to Moose::Meta::Role::Application::BEGIN@6 # spent 389µs making 1 call to metaclass::import
7218µs12µs
# spent 2µs within Moose::Meta::Role::Application::BEGIN@7 which was called: # once (2µs+0s) by Moose::BEGIN@34 at line 7
use overload ();
# spent 2µs making 1 call to Moose::Meta::Role::Application::BEGIN@7
8
9333µs373µs
# spent 54µs (11+43) within Moose::Meta::Role::Application::BEGIN@9 which was called: # once (11µs+43µs) by Moose::BEGIN@34 at line 9
use List::Util 1.33 qw( all );
# spent 54µs making 1 call to Moose::Meta::Role::Application::BEGIN@9 # spent 10µs making 1 call to UNIVERSAL::VERSION # spent 9µs making 1 call to List::Util::import
10
112321µs2264µs
# spent 135µs (6+129) within Moose::Meta::Role::Application::BEGIN@11 which was called: # once (6µs+129µs) by Moose::BEGIN@34 at line 11
use Moose::Util 'throw_exception';
# spent 135µs making 1 call to Moose::Meta::Role::Application::BEGIN@11 # spent 129µ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 default => sub { [] },
1714µs3288µs Class::MOP::_definition_context(),
# spent 268µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 15µs making 1 call to Moose::Meta::Role::Application::meta # spent 4µ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 default => sub { {} },
2413µs3181µs Class::MOP::_definition_context(),
# spent 172µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 6µs making 1 call to Moose::Meta::Role::Application::meta # spent 3µs making 1 call to Class::MOP::_definition_context
25));
26
27sub new {
28 my ($class, %params) = @_;
29 $class->_new(\%params);
30}
31
32sub is_method_excluded {
33 my ($self, $method_name) = @_;
34 foreach (@{$self->get_method_exclusions}) {
35 return 1 if $_ eq $method_name;
36 }
37 return 0;
38}
39
40sub is_method_aliased {
41 my ($self, $method_name) = @_;
42 exists $self->get_method_aliases->{$method_name} ? 1 : 0
43}
44
45sub 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
51sub apply {
52 my $self = shift;
53
54 $self->check_role_exclusions(@_);
55 $self->check_required_methods(@_);
56 $self->check_required_attributes(@_);
57
58 $self->apply_overloading(@_);
59 $self->apply_attributes(@_);
60 $self->apply_methods(@_);
61
62 $self->apply_override_method_modifiers(@_);
63
64 $self->apply_before_method_modifiers(@_);
65 $self->apply_around_method_modifiers(@_);
66 $self->apply_after_method_modifiers(@_);
67}
68
69sub check_role_exclusions { throw_exception( "CannotCallAnAbstractMethod" ); }
70sub check_required_methods { throw_exception( "CannotCallAnAbstractMethod" ); }
71sub check_required_attributes { throw_exception( "CannotCallAnAbstractMethod" ); }
72
73sub apply_attributes { throw_exception( "CannotCallAnAbstractMethod" ); }
74sub apply_methods { throw_exception( "CannotCallAnAbstractMethod" ); }
75sub apply_override_method_modifiers { throw_exception( "CannotCallAnAbstractMethod" ); }
76sub apply_method_modifiers { throw_exception( "CannotCallAnAbstractMethod" ); }
77
78sub apply_before_method_modifiers { (shift)->apply_method_modifiers('before' => @_) }
79sub apply_around_method_modifiers { (shift)->apply_method_modifiers('around' => @_) }
80sub apply_after_method_modifiers { (shift)->apply_method_modifiers('after' => @_) }
81
82sub apply_overloading {
83 my ( $self, $role, $other ) = @_;
84
85 return unless $role->is_overloaded;
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
9915µs1;
100
101# ABSTRACT: A base class for role application
102
103__END__