← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:42:38 2010
Reported on Wed Nov 17 22:08:02 2010

Filename/home/doy/coding/src/Moose/blib/lib//Moose/Role.pm
StatementsExecuted 781 statements in 11.6ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
35115.63ms159msMoose::Role::::init_metaMoose::Role::init_meta
3016161.08ms23.9msMoose::Role::::requiresMoose::Role::requires
3619191.07ms1.38sMoose::Role::::withMoose::Role::with (recurses: max depth 2, inclusive time 194ms)
1485793µs9.06msMoose::Role::::hasMoose::Role::has
1275343µs3.18msMoose::Role::::aroundMoose::Role::around
931248µs1.82msMoose::Role::::_add_method_modifierMoose::Role::_add_method_modifier
1021217µs1.80msMoose::Role::::superMoose::Role::super
642180µs1.83msMoose::Role::::overrideMoose::Role::override
432117µs1.07msMoose::Role::::beforeMoose::Role::before
11175µs94µsMoose::Role::::BEGIN@2Moose::Role::BEGIN@2
22263µs537µsMoose::Role::::afterMoose::Role::after
11139µs8.13msMoose::Role::::BEGIN@19Moose::Role::BEGIN@19
11138µs106µsMoose::Role::::BEGIN@3Moose::Role::BEGIN@3
11138µs672µsMoose::Role::::BEGIN@8Moose::Role::BEGIN@8
11137µs193µsMoose::Role::::BEGIN@5Moose::Role::BEGIN@5
11136µs175µsMoose::Role::::BEGIN@17Moose::Role::BEGIN@17
11135µs158µsMoose::Role::::BEGIN@6Moose::Role::BEGIN@6
11125µs25µsMoose::Role::::BEGIN@18Moose::Role::BEGIN@18
11123µs23µsMoose::Role::::BEGIN@14Moose::Role::BEGIN@14
11118µs18µsMoose::Role::::BEGIN@15Moose::Role::BEGIN@15
0000s0sMoose::Role::::augmentMoose::Role::augment
0000s0sMoose::Role::::excludesMoose::Role::excludes
0000s0sMoose::Role::::extendsMoose::Role::extends
0000s0sMoose::Role::::innerMoose::Role::inner
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Role;
2397µs2112µs
# spent 94µs (75+18) within Moose::Role::BEGIN@2 which was called: # once (75µs+18µs) by KiokuDB::Backend::BEGIN@4 at line 2
use strict;
# spent 94µs making 1 call to Moose::Role::BEGIN@2 # spent 18µs making 1 call to strict::import
33114µs2175µs
# spent 106µs (38+68) within Moose::Role::BEGIN@3 which was called: # once (38µs+68µs) by KiokuDB::Backend::BEGIN@4 at line 3
use warnings;
# spent 106µs making 1 call to Moose::Role::BEGIN@3 # spent 68µs making 1 call to warnings::import
4
53115µs2349µs
# spent 193µs (37+156) within Moose::Role::BEGIN@5 which was called: # once (37µs+156µs) by KiokuDB::Backend::BEGIN@4 at line 5
use Scalar::Util 'blessed';
# spent 193µs making 1 call to Moose::Role::BEGIN@5 # spent 156µs making 1 call to Exporter::import
6392µs2282µs
# spent 158µs (35+123) within Moose::Role::BEGIN@6 which was called: # once (35µs+123µs) by KiokuDB::Backend::BEGIN@4 at line 6
use Carp 'croak';
# spent 158µs making 1 call to Moose::Role::BEGIN@6 # spent 123µs making 1 call to Exporter::import
7
83246µs21.31ms
# spent 672µs (38+634) within Moose::Role::BEGIN@8 which was called: # once (38µs+634µs) by KiokuDB::Backend::BEGIN@4 at line 8
use Sub::Exporter;
# spent 672µs making 1 call to Moose::Role::BEGIN@8 # spent 634µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
9
1014µsour $VERSION = '1.19';
11161µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
1213µsour $AUTHORITY = 'cpan:STEVAN';
13
14379µs123µs
# spent 23µs within Moose::Role::BEGIN@14 which was called: # once (23µs+0s) by KiokuDB::Backend::BEGIN@4 at line 14
use Moose ();
# spent 23µs making 1 call to Moose::Role::BEGIN@14
15380µs118µs
# spent 18µs within Moose::Role::BEGIN@15 which was called: # once (18µs+0s) by KiokuDB::Backend::BEGIN@4 at line 15
use Moose::Util ();
# spent 18µs making 1 call to Moose::Role::BEGIN@15
16
173122µs2314µs
# spent 175µs (36+139) within Moose::Role::BEGIN@17 which was called: # once (36µs+139µs) by KiokuDB::Backend::BEGIN@4 at line 17
use Moose::Exporter;
# spent 175µs making 1 call to Moose::Role::BEGIN@17 # spent 139µs making 1 call to Moose::Exporter::import
18388µs125µs
# spent 25µs within Moose::Role::BEGIN@18 which was called: # once (25µs+0s) by KiokuDB::Backend::BEGIN@4 at line 18
use Moose::Meta::Role;
# spent 25µs making 1 call to Moose::Role::BEGIN@18
1932.53ms216.2ms
# spent 8.13ms (39µs+8.09) within Moose::Role::BEGIN@19 which was called: # once (39µs+8.09ms) by KiokuDB::Backend::BEGIN@4 at line 19
use Moose::Util::TypeConstraints;
# spent 8.13ms making 1 call to Moose::Role::BEGIN@19 # spent 8.09ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456]
20
21sub extends {
22 croak "Roles do not support 'extends' (you can use 'with' to specialize a role)";
23}
24
25
# spent 1.38s (1.07ms+1.38) within Moose::Role::with which was called 36 times, avg 38.4ms/call: # 18 times (372µs+593ms) by Moose::Role::with at line 359 of Moose/Exporter.pm, avg 33.0ms/call # once (37µs+193ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Array/push.pm # once (42µs+140ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Array/Writer.pm # once (35µs+102ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 10 of KiokuDB/TypeMap/Entry/Std.pm # once (39µs+74.3ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Moose/Meta/Method/Accessor/Native/Hash/values.pm # once (38µs+46.0ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 9 of Moose/Meta/Attribute/Native/Trait/Hash.pm # once (38µs+40.4ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Reader.pm # once (34µs+29.8ms) by MooseX::Clone::BEGIN@11 at line 10 of MooseX/Clone/Meta/Attribute/Trait/StorableClone.pm # once (39µs+29.0ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Array/clear.pm # once (44µs+28.5ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 17 of KiokuDB/Role/UUIDs.pm # once (42µs+26.4ms) by MooseX::Clone::BEGIN@10 at line 10 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm # once (36µs+22.6ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 6 of KiokuDB/Error.pm # once (39µs+13.9ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Array/elements.pm # once (38µs+13.8ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Moose/Meta/Method/Accessor/Native/Hash/keys.pm # once (50µs+11.4ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Moose/Meta/Method/Accessor/Native/Writer.pm # once (39µs+8.83ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 9 of Moose/Meta/Attribute/Native/Trait/Array.pm # once (38µs+2.95ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 6 of MooseX/Clone/Meta/Attribute/Trait/Clone/Std.pm # once (33µs+2.89ms) by MooseX::Clone::BEGIN@12 at line 8 of MooseX/Clone/Meta/Attribute/Trait/NoClone.pm # once (34µs+2.84ms) by MooseX::Clone::BEGIN@13 at line 10 of MooseX/Clone/Meta/Attribute/Trait/Copy.pm
sub with {
2618378µs18378ms Moose::Util::apply_all_roles( shift, @_ );
# spent 787ms making 18 calls to Moose::Util::apply_all_roles, avg 43.7ms/call, recursion: max depth 2, sum of overlapping time 409ms
27}
28
29
# spent 23.9ms (1.08+22.8) within Moose::Role::requires which was called 30 times, avg 798µs/call: # 15 times (474µs+10.7ms) by Moose::Role::requires at line 359 of Moose/Exporter.pm, avg 747µs/call # once (36µs+5.10ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 6 of KiokuDB/Role/API.pm # once (45µs+1.05ms) by KiokuDB::BEGIN@10 at line 26 of KiokuDB/Backend.pm # once (34µs+827µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of KiokuDB/TypeMap/Entry/Std/Compile.pm # once (36µs+661µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of KiokuDB/TypeMap/Entry/Std/Expand.pm # once (97µs+466µs) by KiokuDB::TypeMap::BEGIN@9 at line 8 of KiokuDB/TypeMap/Entry.pm # once (36µs+510µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of KiokuDB/Error.pm # once (34µs+504µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 16 of Moose/Meta/Method/Accessor/Native/Writer.pm # once (37µs+485µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 13 of Moose/Meta/Attribute/Native/Trait.pm # once (33µs+484µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Data/Stream/Bulk.pm # once (50µs+425µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of MooseX/Clone/Meta/Attribute/Trait/Clone/Std.pm # once (36µs+355µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (35µs+332µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Moose/Meta/Method/Accessor/Native/Reader.pm # once (33µs+314µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of KiokuDB/Role/TypeMap.pm # once (34µs+312µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of KiokuDB/TypeMap/Entry/Std/Intrinsic.pm # once (33µs+305µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of MooseX/Clone/Meta/Attribute/Trait/Clone/Base.pm
sub requires {
301550µs my $meta = shift;
311533µs croak "Must specify at least one method" unless @_;
3215361µs1510.7ms $meta->add_required_methods(@_);
# spent 10.7ms making 15 calls to Moose::Meta::Role::add_required_methods, avg 715µs/call
33}
34
35sub excludes {
36 my $meta = shift;
37 croak "Must specify at least one role" unless @_;
38 $meta->add_excluded_roles(@_);
39}
40
41
# spent 9.06ms (793µs+8.27) within Moose::Role::has which was called 14 times, avg 647µs/call: # 7 times (534µs+3.69ms) by Moose::Role::has at line 359 of Moose/Exporter.pm, avg 604µs/call # once (47µs+863µs) by MooseX::Clone::BEGIN@10 at line 14 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm # once (37µs+661µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 15 of Moose/Meta/Attribute/Native/Trait.pm # once (38µs+648µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 10 of KiokuDB/TypeMap/Entry/Std/Intrinsic.pm # once (38µs+647µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 16 of Throwable.pm # once (35µs+637µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 191 of Moose/Meta/Attribute/Native/Trait.pm # once (33µs+568µs) by MooseX::Clone::BEGIN@10 at line 30 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm # once (33µs+550µs) by MooseX::Clone::BEGIN@10 at line 20 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm
sub has {
42720µs my $meta = shift;
43720µs my $name = shift;
44718µs croak 'Usage: has \'name\' => ( key => value, ... )' if @_ == 1;
457131µs7286µs my %options = ( definition_context => Moose::Util::_caller_info(), @_ );
# spent 286µs making 7 calls to Moose::Util::_caller_info, avg 41µs/call
46742µs my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];
4714282µs73.41ms $meta->add_attribute( $_, %options ) for @$attrs;
# spent 3.41ms making 7 calls to Moose::Meta::Role::add_attribute, avg 487µs/call
48}
49
50
# spent 1.82ms (248µs+1.58) within Moose::Role::_add_method_modifier which was called 9 times, avg 203µs/call: # 6 times (168µs+1.04ms) by Moose::Role::around at line 66, avg 202µs/call # 2 times (56µs+352µs) by Moose::Role::before at line 62, avg 204µs/call # once (24µs+179µs) by Moose::Role::after at line 64
sub _add_method_modifier {
51928µs my $type = shift;
52921µs my $meta = shift;
53
54925µs if ( ref($_[0]) eq 'Regexp' ) {
55 croak "Roles do not currently support regex "
56 . " references for $type method modifiers";
57 }
58
599180µs91.58ms Moose::Util::add_method_modifier($meta, $type, \@_);
# spent 1.58ms making 9 calls to Moose::Util::add_method_modifier, avg 175µs/call
60}
61
62242µs2408µs
# spent 1.07ms (117µs+950µs) within Moose::Role::before which was called 4 times, avg 267µs/call: # 2 times (39µs+408µs) by Moose::Role::before at line 359 of Moose/Exporter.pm, avg 224µs/call # once (48µs+307µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 51 of Moose/Meta/Attribute/Native/Trait.pm # once (29µs+235µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 101 of Moose/Meta/Attribute/Native/Trait.pm
sub before { _add_method_modifier('before', @_) }
# spent 408µs making 2 calls to Moose::Role::_add_method_modifier, avg 204µs/call
63
64120µs1203µs
# spent 537µs (63+474) within Moose::Role::after which was called 2 times, avg 269µs/call: # once (42µs+271µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 83 of Moose/Meta/Attribute/Native/Trait.pm # once (21µs+203µs) by Moose::Role::after at line 359 of Moose/Exporter.pm
sub after { _add_method_modifier('after', @_) }
# spent 203µs making 1 call to Moose::Role::_add_method_modifier
65
666119µs61.21ms
# spent 3.18ms (343µs+2.83) within Moose::Role::around which was called 12 times, avg 265µs/call: # 6 times (111µs+1.21ms) by Moose::Role::around at line 359 of Moose/Exporter.pm, avg 221µs/call # once (36µs+313µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 32 of Moose/Meta/Method/Accessor/Native.pm # once (64µs+261µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 136 of Moose/Meta/Attribute/Native/Trait.pm # once (37µs+286µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 121 of Moose/Meta/Method/Accessor/Native/Writer.pm # once (33µs+273µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 147 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (31µs+247µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 143 of Moose/Meta/Method/Accessor/Native/Writer.pm # once (31µs+243µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 158 of Moose/Meta/Attribute/Native/Trait.pm
sub around { _add_method_modifier('around', @_) }
# spent 1.21ms making 6 calls to Moose::Role::_add_method_modifier, avg 202µs/call
67
68# see Moose.pm for discussion
69
# spent 1.80ms (217µs+1.58) within Moose::Role::super which was called 10 times, avg 180µs/call: # 5 times (109µs+904µs) by Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm:114] at line 111 of Moose/Meta/Method/Accessor/Native.pm, avg 203µs/call # 5 times (109µs+677µs) by Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm:145] at line 128 of Moose/Meta/Method/Accessor/Native.pm, avg 157µs/call
sub super {
701023µs return unless $Moose::SUPER_BODY;
7110184µs101.58ms $Moose::SUPER_BODY->(@Moose::SUPER_ARGS);
# spent 904µs making 5 calls to Moose::Meta::Method::Accessor::_get_value, avg 181µs/call # spent 677µs making 5 calls to Moose::Meta::Method::Accessor::_eval_environment, avg 135µs/call
72}
73
74
# spent 1.83ms (180µs+1.65) within Moose::Role::override which was called 6 times, avg 305µs/call: # 3 times (79µs+681µs) by Moose::Role::override at line 359 of Moose/Exporter.pm, avg 253µs/call # once (42µs+401µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 114 of Moose/Meta/Method/Accessor/Native.pm # once (30µs+327µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 123 of Moose/Meta/Method/Accessor/Native.pm # once (29µs+242µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 145 of Moose/Meta/Method/Accessor/Native.pm
sub override {
7538µs my $meta = shift;
76312µs my ( $name, $code ) = @_;
77355µs3681µs $meta->add_override_method_modifier( $name, $code );
# spent 681µs making 3 calls to Moose::Meta::Role::add_override_method_modifier, avg 227µs/call
78}
79
80sub inner {
81 croak "Roles cannot support 'inner'";
82}
83
84sub augment {
85 croak "Roles cannot support 'augment'";
86}
87
88133µs14.67msMoose::Exporter->setup_import_methods(
# spent 4.67ms making 1 call to Moose::Exporter::setup_import_methods
89 with_meta => [
90 qw( with requires excludes has before after around override )
91 ],
92 as_is => [
93 qw( extends super inner augment ),
94 \&Carp::confess,
95 \&Scalar::Util::blessed,
96 ],
97);
98
99
# spent 159ms (5.63+153) within Moose::Role::init_meta which was called 35 times, avg 4.53ms/call: # 35 times (5.63ms+153ms) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 423 of Moose/Exporter.pm, avg 4.53ms/call
sub init_meta {
1003586µs shift;
10135382µs my %args = @_;
102
10335152µs my $role = $args{for_class};
104
1053567µs unless ($role) {
106 require Moose;
107 Moose->throw_error("Cannot call init_meta without specifying a for_class");
108 }
109
11035138µs my $metaclass = $args{metaclass} || "Moose::Meta::Role";
11135141µs my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta';
112
113351.00ms35377µs Moose->throw_error("The Metaclass $metaclass must be a subclass of Moose::Meta::Role.")
# spent 377µs making 35 calls to UNIVERSAL::isa, avg 11µs/call
114 unless $metaclass->isa('Moose::Meta::Role');
115
116 # make a subtype for each Moose role
11735798µs7033.3ms role_type $role unless find_type_constraint($role);
# spent 29.8ms making 35 calls to Moose::Util::TypeConstraints::role_type, avg 853µs/call # spent 3.48ms making 35 calls to Moose::Util::TypeConstraints::find_type_constraint, avg 99µs/call
118
1193575µs my $meta;
12035556µs35451µs if ( $meta = Class::MOP::get_metaclass_by_name($role) ) {
# spent 451µs making 35 calls to Class::MOP::get_metaclass_by_name, avg 13µs/call
121 unless ( $meta->isa("Moose::Meta::Role") ) {
122 my $error_message = "$role already has a metaclass, but it does not inherit $metaclass ($meta).";
123 if ( $meta->isa('Moose::Meta::Class') ) {
124 Moose->throw_error($error_message . ' You cannot make the same thing a role and a class. Remove either Moose or Moose::Role.');
125 } else {
126 Moose->throw_error($error_message);
127 }
128 }
129 }
130 else {
13135514µs3525.5ms $meta = $metaclass->initialize($role);
# spent 25.5ms making 35 calls to Moose::Meta::Role::initialize, avg 728µs/call
132 }
133
13435253µs if (defined $meta_name) {
135 # also check for inherited non moose 'meta' method?
13635512µs358.02ms my $existing = $meta->get_method($meta_name);
# spent 8.02ms making 35 calls to Class::MOP::Mixin::HasMethods::get_method, avg 229µs/call
1373571µs if ($existing && !$existing->isa('Class::MOP::Method::Meta')) {
138 Carp::cluck "Moose::Role is overwriting an existing method named "
139 . "$meta_name in role $role with a method "
140 . "which returns the class's metaclass. If this is "
141 . "actually what you want, you should remove the "
142 . "existing method, otherwise, you should rename or "
143 . "disable this generated method using the "
144 . "'-meta_name' option to 'use Moose::Role'.";
145 }
14635482µs3585.4ms $meta->_add_meta_method($meta_name);
# spent 85.4ms making 35 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 2.44ms/call
147 }
148
14935634µs return $meta;
150}
151
152131µs1;
153
154__END__