| Filename | /home/doy/coding/src/Moose/blib/lib//Moose/Role.pm |
| Statements | Executed 921 statements in 13.1ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 40 | 2 | 2 | 6.39ms | 191ms | Moose::Role::init_meta |
| 52 | 27 | 27 | 1.60ms | 1.96s | Moose::Role::with (recurses: max depth 2, inclusive time 309ms) |
| 18 | 10 | 7 | 1.12ms | 12.2ms | Moose::Role::has |
| 18 | 10 | 10 | 656µs | 7.12ms | Moose::Role::requires |
| 28 | 2 | 1 | 603µs | 6.85ms | Moose::Role::super |
| 16 | 9 | 7 | 434µs | 4.31ms | Moose::Role::around |
| 13 | 3 | 1 | 365µs | 2.73ms | Moose::Role::_add_method_modifier |
| 6 | 4 | 2 | 184µs | 1.76ms | Moose::Role::override |
| 6 | 4 | 3 | 179µs | 1.79ms | Moose::Role::before |
| 4 | 3 | 3 | 147µs | 1.12ms | Moose::Role::after |
| 1 | 1 | 1 | 95µs | 267µs | Moose::Role::BEGIN@5 |
| 1 | 1 | 1 | 63µs | 78µs | Moose::Role::BEGIN@2 |
| 1 | 1 | 1 | 54µs | 194µs | Moose::Role::BEGIN@6 |
| 1 | 1 | 1 | 48µs | 110µs | Moose::Role::BEGIN@3 |
| 1 | 1 | 1 | 39µs | 8.07ms | Moose::Role::BEGIN@19 |
| 1 | 1 | 1 | 37µs | 692µs | Moose::Role::BEGIN@8 |
| 1 | 1 | 1 | 35µs | 169µs | Moose::Role::BEGIN@17 |
| 1 | 1 | 1 | 26µs | 26µs | Moose::Role::BEGIN@18 |
| 1 | 1 | 1 | 24µs | 24µs | Moose::Role::BEGIN@14 |
| 1 | 1 | 1 | 19µs | 19µs | Moose::Role::BEGIN@15 |
| 0 | 0 | 0 | 0s | 0s | Moose::Role::augment |
| 0 | 0 | 0 | 0s | 0s | Moose::Role::excludes |
| 0 | 0 | 0 | 0s | 0s | Moose::Role::extends |
| 0 | 0 | 0 | 0s | 0s | Moose::Role::inner |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Role; | ||||
| 2 | 3 | 105µs | 2 | 94µs | # spent 78µs (63+16) within Moose::Role::BEGIN@2 which was called:
# once (63µs+16µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 2 # spent 78µs making 1 call to Moose::Role::BEGIN@2
# spent 16µs making 1 call to strict::import |
| 3 | 3 | 104µs | 2 | 172µs | # spent 110µs (48+62) within Moose::Role::BEGIN@3 which was called:
# once (48µs+62µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 3 # spent 110µs making 1 call to Moose::Role::BEGIN@3
# spent 62µs making 1 call to warnings::import |
| 4 | |||||
| 5 | 3 | 125µs | 2 | 440µs | # spent 267µs (95+172) within Moose::Role::BEGIN@5 which was called:
# once (95µs+172µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 5 # spent 267µs making 1 call to Moose::Role::BEGIN@5
# spent 172µs making 1 call to Exporter::import |
| 6 | 3 | 103µs | 2 | 333µs | # spent 194µs (54+139) within Moose::Role::BEGIN@6 which was called:
# once (54µs+139µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 6 # spent 194µs making 1 call to Moose::Role::BEGIN@6
# spent 139µs making 1 call to Exporter::import |
| 7 | |||||
| 8 | 3 | 230µs | 2 | 1.35ms | # spent 692µs (37+654) within Moose::Role::BEGIN@8 which was called:
# once (37µs+654µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 8 # spent 692µs making 1 call to Moose::Role::BEGIN@8
# spent 654µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756] |
| 9 | |||||
| 10 | 1 | 4µs | our $VERSION = '1.19'; | ||
| 11 | 1 | 63µs | $VERSION = eval $VERSION; # spent 11µs executing statements in string eval | ||
| 12 | 1 | 3µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 13 | |||||
| 14 | 3 | 83µs | 1 | 24µs | # spent 24µs within Moose::Role::BEGIN@14 which was called:
# once (24µs+0s) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 14 # spent 24µs making 1 call to Moose::Role::BEGIN@14 |
| 15 | 3 | 83µs | 1 | 19µs | # spent 19µs within Moose::Role::BEGIN@15 which was called:
# once (19µs+0s) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 15 # spent 19µs making 1 call to Moose::Role::BEGIN@15 |
| 16 | |||||
| 17 | 3 | 126µs | 2 | 304µs | # spent 169µs (35+135) within Moose::Role::BEGIN@17 which was called:
# once (35µs+135µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 17 # spent 169µs making 1 call to Moose::Role::BEGIN@17
# spent 135µs making 1 call to Moose::Exporter::import |
| 18 | 3 | 89µs | 1 | 26µs | # spent 26µs within Moose::Role::BEGIN@18 which was called:
# once (26µs+0s) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 18 # spent 26µs making 1 call to Moose::Role::BEGIN@18 |
| 19 | 3 | 2.53ms | 2 | 16.1ms | # spent 8.07ms (39µs+8.03) within Moose::Role::BEGIN@19 which was called:
# once (39µs+8.03ms) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 19 # spent 8.07ms making 1 call to Moose::Role::BEGIN@19
# spent 8.03ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456] |
| 20 | |||||
| 21 | sub extends { | ||||
| 22 | croak "Roles do not support 'extends' (you can use 'with' to specialize a role)"; | ||||
| 23 | } | ||||
| 24 | |||||
| 25 | # spent 1.96s (1.60ms+1.96) within Moose::Role::with which was called 52 times, avg 37.8ms/call:
# 26 times (562µs+825ms) by Moose::Role::with at line 359 of Moose/Exporter.pm, avg 31.8ms/call
# once (39µs+164ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 15 of Moose/Meta/Method/Accessor/Native/Hash/set.pm
# once (39µs+128ms) 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 (38µs+115ms) 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/Writer.pm
# once (37µs+103ms) 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/get.pm
# once (42µs+87.3ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Markdent/Role/BlockParser.pm
# once (40µs+68.3ms) 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 (40µs+56.9ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 20 of Markdent/Role/HTMLStream.pm
# once (37µs+48.6ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Markdent/Role/AnyParser.pm
# once (38µs+45.9ms) 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+38.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/Reader.pm
# once (39µs+36.3ms) 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 (44µs+27.7ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Markdent/Role/EventsAsMethods.pm
# once (38µs+23.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/Bool/unset.pm
# once (42µs+22.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/Bool/set.pm
# once (39µs+22.2ms) 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/String/clear.pm
# once (38µs+21.7ms) 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/Counter/inc.pm
# once (39µs+21.7ms) 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/String/append.pm
# once (38µs+21.7ms) 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/Counter/dec.pm
# once (39µs+14.1ms) 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+14.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/String/length.pm
# once (40µs+10.7ms) 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 (56µs+9.11ms) 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/Counter.pm
# once (37µs+9.06ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of Moose/Meta/Attribute/Native/Trait/String.pm
# once (39µs+9.05ms) 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+8.95ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of Moose/Meta/Attribute/Native/Trait/Bool.pm
# once (44µs+8.87ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Markdent/Role/SpanParser.pm | ||||
| 26 | 26 | 542µs | 26 | 673ms | Moose::Util::apply_all_roles( shift, @_ ); # spent 1.13s making 26 calls to Moose::Util::apply_all_roles, avg 43.6ms/call, recursion: max depth 2, sum of overlapping time 461ms |
| 27 | } | ||||
| 28 | |||||
| 29 | # spent 7.12ms (656µs+6.47) within Moose::Role::requires which was called 18 times, avg 396µs/call:
# 9 times (271µs+2.81ms) by Moose::Role::requires at line 359 of Moose/Exporter.pm, avg 342µs/call
# once (61µs+582µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Markdent/Role/SpanParser.pm
# once (45µs+575µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Markdent/Role/Handler.pm
# once (39µs+479µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 22 of Markdent/Role/HTMLStream.pm
# once (50µs+419µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Markdent/Role/BlockParser.pm
# once (37µs+332µ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 (40µs+325µ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 (39µs+324µ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 (37µs+319µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 12 of Markdent/Role/EventAsText.pm
# once (37µs+304µ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 | ||||
| 30 | 9 | 30µs | my $meta = shift; | ||
| 31 | 9 | 21µs | croak "Must specify at least one method" unless @_; | ||
| 32 | 9 | 205µs | 9 | 2.81ms | $meta->add_required_methods(@_); # spent 2.81ms making 9 calls to Moose::Meta::Role::add_required_methods, avg 312µs/call |
| 33 | } | ||||
| 34 | |||||
| 35 | sub excludes { | ||||
| 36 | my $meta = shift; | ||||
| 37 | croak "Must specify at least one role" unless @_; | ||||
| 38 | $meta->add_excluded_roles(@_); | ||||
| 39 | } | ||||
| 40 | |||||
| 41 | # spent 12.2ms (1.12+11.1) within Moose::Role::has which was called 18 times, avg 680µs/call:
# 9 times (754µs+4.95ms) by Moose::Role::has at line 359 of Moose/Exporter.pm, avg 633µs/call
# once (56µs+921µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 16 of Markdent/Role/BlockParser.pm
# once (48µs+851µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 24 of Markdent/Role/HTMLStream.pm
# once (41µs+717µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 8 of MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm
# once (41µs+652µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Markdent/Role/AnyParser.pm
# once (40µs+627µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of Markdent/Role/DebugPrinter.pm
# once (36µs+630µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 37 of Markdent/Role/HTMLStream.pm
# once (37µs+611µ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 (35µs+600µ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+557µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 14 of MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm | ||||
| 42 | 9 | 26µs | my $meta = shift; | ||
| 43 | 9 | 30µs | my $name = shift; | ||
| 44 | 9 | 26µs | croak 'Usage: has \'name\' => ( key => value, ... )' if @_ == 1; | ||
| 45 | 9 | 191µs | 9 | 366µs | my %options = ( definition_context => Moose::Util::_caller_info(), @_ ); # spent 366µs making 9 calls to Moose::Util::_caller_info, avg 41µs/call |
| 46 | 9 | 56µs | my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ]; | ||
| 47 | 18 | 401µs | 9 | 4.58ms | $meta->add_attribute( $_, %options ) for @$attrs; # spent 4.58ms making 9 calls to Moose::Meta::Role::add_attribute, avg 509µs/call |
| 48 | } | ||||
| 49 | |||||
| 50 | # spent 2.73ms (365µs+2.36) within Moose::Role::_add_method_modifier which was called 13 times, avg 210µs/call:
# 8 times (217µs+1.41ms) by Moose::Role::around at line 66, avg 203µs/call
# 3 times (94µs+594µs) by Moose::Role::before at line 62, avg 229µs/call
# 2 times (54µs+362µs) by Moose::Role::after at line 64, avg 208µs/call | ||||
| 51 | 13 | 42µs | my $type = shift; | ||
| 52 | 13 | 28µs | my $meta = shift; | ||
| 53 | |||||
| 54 | 13 | 38µs | if ( ref($_[0]) eq 'Regexp' ) { | ||
| 55 | croak "Roles do not currently support regex " | ||||
| 56 | . " references for $type method modifiers"; | ||||
| 57 | } | ||||
| 58 | |||||
| 59 | 13 | 271µs | 13 | 2.36ms | Moose::Util::add_method_modifier($meta, $type, \@_); # spent 2.36ms making 13 calls to Moose::Util::add_method_modifier, avg 182µs/call |
| 60 | } | ||||
| 61 | |||||
| 62 | 3 | 54µs | 3 | 688µs | # spent 1.79ms (179µs+1.61) within Moose::Role::before which was called 6 times, avg 298µs/call:
# 3 times (66µs+687µs) by Moose::Role::before at line 359 of Moose/Exporter.pm, avg 251µs/call
# once (45µs+351µs) by MooseX::SemiAffordanceAccessor::BEGIN@12 at line 34 of MooseX/SemiAffordanceAccessor/Role/Attribute.pm
# once (37µs+285µ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 (30µs+287µ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 # spent 688µs making 3 calls to Moose::Role::_add_method_modifier, avg 229µs/call |
| 63 | |||||
| 64 | 2 | 37µs | 2 | 415µs | # spent 1.12ms (147µs+977µs) within Moose::Role::after which was called 4 times, avg 281µs/call:
# 2 times (40µs+415µs) by Moose::Role::after at line 359 of Moose/Exporter.pm, avg 228µs/call
# once (45µs+310µs) by MooseX::StrictConstructor::BEGIN@12 at line 30 of MooseX/StrictConstructor/Role/Object.pm
# once (62µs+252µ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 # spent 415µs making 2 calls to Moose::Role::_add_method_modifier, avg 208µs/call |
| 65 | |||||
| 66 | 8 | 133µs | 8 | 1.62ms | # spent 4.31ms (434µs+3.87) within Moose::Role::around which was called 16 times, avg 269µs/call:
# 8 times (146µs+1.62ms) by Moose::Role::around at line 359 of Moose/Exporter.pm, avg 221µs/call
# once (39µs+375µ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 (49µs+313µs) by MooseX::StrictConstructor::BEGIN@13 at line 35 of MooseX/StrictConstructor/Role/Meta/Class.pm
# once (36µs+278µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 45 of Moose/Meta/Method/Accessor/Native/Hash/set.pm
# once (33µs+274µ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 (35µs+273µ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 (34µs+255µ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 (30µs+244µ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 (30µs+239µ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 # spent 1.62ms making 8 calls to Moose::Role::_add_method_modifier, avg 203µs/call |
| 67 | |||||
| 68 | # see Moose.pm for discussion | ||||
| 69 | # spent 6.85ms (603µs+6.24) within Moose::Role::super which was called 28 times, avg 245µs/call:
# 14 times (306µs+3.84ms) 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 296µs/call
# 14 times (298µs+2.40ms) 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 193µs/call | ||||
| 70 | 28 | 63µs | return unless $Moose::SUPER_BODY; | ||
| 71 | 28 | 494µs | 28 | 6.24ms | $Moose::SUPER_BODY->(@Moose::SUPER_ARGS); # spent 3.84ms making 14 calls to Moose::Meta::Method::Accessor::_eval_environment, avg 274µs/call
# spent 2.40ms making 14 calls to Moose::Meta::Method::Accessor::_get_value, avg 172µs/call |
| 72 | } | ||||
| 73 | |||||
| 74 | # spent 1.76ms (184µs+1.58) within Moose::Role::override which was called 6 times, avg 294µs/call:
# 3 times (81µs+681µs) by Moose::Role::override at line 359 of Moose/Exporter.pm, avg 254µ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+253µ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 (30µs+245µ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 | ||||
| 75 | 3 | 8µs | my $meta = shift; | ||
| 76 | 3 | 13µs | my ( $name, $code ) = @_; | ||
| 77 | 3 | 56µs | 3 | 680µs | $meta->add_override_method_modifier( $name, $code ); # spent 680µs making 3 calls to Moose::Meta::Role::add_override_method_modifier, avg 227µs/call |
| 78 | } | ||||
| 79 | |||||
| 80 | sub inner { | ||||
| 81 | croak "Roles cannot support 'inner'"; | ||||
| 82 | } | ||||
| 83 | |||||
| 84 | sub augment { | ||||
| 85 | croak "Roles cannot support 'augment'"; | ||||
| 86 | } | ||||
| 87 | |||||
| 88 | 1 | 34µs | 1 | 7.20ms | Moose::Exporter->setup_import_methods( # spent 7.20ms 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 191ms (6.39+185) within Moose::Role::init_meta which was called 40 times, avg 4.77ms/call:
# 38 times (6.02ms+164ms) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 423 of Moose/Exporter.pm, avg 4.46ms/call
# 2 times (372µs+20.9ms) by MooseX::Role::Parameterized::init_meta at line 49 of MooseX/Role/Parameterized.pm, avg 10.6ms/call | ||||
| 100 | 40 | 100µs | shift; | ||
| 101 | 40 | 429µs | my %args = @_; | ||
| 102 | |||||
| 103 | 40 | 145µs | my $role = $args{for_class}; | ||
| 104 | |||||
| 105 | 40 | 72µs | unless ($role) { | ||
| 106 | require Moose; | ||||
| 107 | Moose->throw_error("Cannot call init_meta without specifying a for_class"); | ||||
| 108 | } | ||||
| 109 | |||||
| 110 | 40 | 147µs | my $metaclass = $args{metaclass} || "Moose::Meta::Role"; | ||
| 111 | 40 | 164µs | my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta'; | ||
| 112 | |||||
| 113 | 40 | 1.15ms | 40 | 414µs | Moose->throw_error("The Metaclass $metaclass must be a subclass of Moose::Meta::Role.") # spent 414µs making 40 calls to UNIVERSAL::isa, avg 10µs/call |
| 114 | unless $metaclass->isa('Moose::Meta::Role'); | ||||
| 115 | |||||
| 116 | # make a subtype for each Moose role | ||||
| 117 | 40 | 882µs | 80 | 36.4ms | role_type $role unless find_type_constraint($role); # spent 32.6ms making 40 calls to Moose::Util::TypeConstraints::role_type, avg 814µs/call
# spent 3.88ms making 40 calls to Moose::Util::TypeConstraints::find_type_constraint, avg 97µs/call |
| 118 | |||||
| 119 | 40 | 84µs | my $meta; | ||
| 120 | 40 | 595µs | 40 | 489µs | if ( $meta = Class::MOP::get_metaclass_by_name($role) ) { # spent 489µs making 40 calls to Class::MOP::get_metaclass_by_name, avg 12µ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 { | ||||
| 131 | 40 | 621µs | 40 | 41.1ms | $meta = $metaclass->initialize($role); # spent 41.1ms making 40 calls to Moose::Meta::Role::initialize, avg 1.03ms/call |
| 132 | } | ||||
| 133 | |||||
| 134 | 40 | 281µs | if (defined $meta_name) { | ||
| 135 | # also check for inherited non moose 'meta' method? | ||||
| 136 | 40 | 575µs | 40 | 9.13ms | my $existing = $meta->get_method($meta_name); # spent 9.13ms making 40 calls to Class::MOP::Mixin::HasMethods::get_method, avg 228µs/call |
| 137 | 40 | 89µ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 | } | ||||
| 146 | 40 | 565µs | 40 | 96.9ms | $meta->_add_meta_method($meta_name); # spent 96.9ms making 40 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 2.42ms/call |
| 147 | } | ||||
| 148 | |||||
| 149 | 40 | 696µs | return $meta; | ||
| 150 | } | ||||
| 151 | |||||
| 152 | 1 | 31µs | 1; | ||
| 153 | |||||
| 154 | __END__ |