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

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Role.pm
StatementsExecuted 1685 statements in 22.0ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
832213.9ms416msMoose::Role::::init_metaMoose::Role::init_meta
13870704.33ms5.93sMoose::Role::::withMoose::Role::with (recurses: max depth 3, inclusive time 895ms)
181071.08ms12.3msMoose::Role::::hasMoose::Role::has
28158735µs7.13msMoose::Role::::aroundMoose::Role::around
2821667µs7.40msMoose::Role::::superMoose::Role::super
181010619µs6.16msMoose::Role::::requiresMoose::Role::requires
1931501µs3.79msMoose::Role::::_add_method_modifierMoose::Role::_add_method_modifier
853261µs3.39msMoose::Role::::overrideMoose::Role::override
643170µs1.69msMoose::Role::::beforeMoose::Role::before
433117µs1.09msMoose::Role::::afterMoose::Role::after
11167µs86µsMoose::Role::::BEGIN@2Moose::Role::BEGIN@2
11159µs849µsMoose::Role::::BEGIN@8Moose::Role::BEGIN@8
11146µs277µsMoose::Role::::BEGIN@6Moose::Role::BEGIN@6
11145µs8.18msMoose::Role::::BEGIN@19Moose::Role::BEGIN@19
11140µs107µsMoose::Role::::BEGIN@3Moose::Role::BEGIN@3
11136µs196µsMoose::Role::::BEGIN@5Moose::Role::BEGIN@5
11134µs170µsMoose::Role::::BEGIN@17Moose::Role::BEGIN@17
11125µs25µsMoose::Role::::BEGIN@14Moose::Role::BEGIN@14
11124µs24µsMoose::Role::::BEGIN@18Moose::Role::BEGIN@18
11120µs20µ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;
23188µs2106µs
# spent 86µs (67+20) within Moose::Role::BEGIN@2 which was called: # once (67µs+20µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 2
use strict;
# spent 86µs making 1 call to Moose::Role::BEGIN@2 # spent 20µs making 1 call to strict::import
33100µs2174µs
# spent 107µs (40+67) within Moose::Role::BEGIN@3 which was called: # once (40µs+67µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 3
use warnings;
# spent 107µs making 1 call to Moose::Role::BEGIN@3 # spent 67µs making 1 call to warnings::import
4
53101µs2356µs
# spent 196µs (36+160) within Moose::Role::BEGIN@5 which was called: # once (36µs+160µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 5
use Scalar::Util 'blessed';
# spent 196µs making 1 call to Moose::Role::BEGIN@5 # spent 160µs making 1 call to Exporter::import
63166µs2509µs
# spent 277µs (46+231) within Moose::Role::BEGIN@6 which was called: # once (46µs+231µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 6
use Carp 'croak';
# spent 277µs making 1 call to Moose::Role::BEGIN@6 # spent 231µs making 1 call to Exporter::import
7
83251µs21.64ms
# spent 849µs (59+790) within Moose::Role::BEGIN@8 which was called: # once (59µs+790µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 8
use Sub::Exporter;
# spent 849µs making 1 call to Moose::Role::BEGIN@8 # spent 790µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
9
1016µsour $VERSION = '1.19';
11170µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
1213µsour $AUTHORITY = 'cpan:STEVAN';
13
14384µs125µs
# spent 25µs within Moose::Role::BEGIN@14 which was called: # once (25µs+0s) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 14
use Moose ();
# spent 25µs making 1 call to Moose::Role::BEGIN@14
15382µs120µs
# spent 20µs within Moose::Role::BEGIN@15 which was called: # once (20µs+0s) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 15
use Moose::Util ();
# spent 20µs making 1 call to Moose::Role::BEGIN@15
16
17396µs2306µs
# spent 170µs (34+136) within Moose::Role::BEGIN@17 which was called: # once (34µs+136µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 17
use Moose::Exporter;
# spent 170µs making 1 call to Moose::Role::BEGIN@17 # spent 136µs making 1 call to Moose::Exporter::import
183105µs124µs
# spent 24µs within Moose::Role::BEGIN@18 which was called: # once (24µs+0s) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 18
use Moose::Meta::Role;
# spent 24µs making 1 call to Moose::Role::BEGIN@18
1932.47ms216.3ms
# spent 8.18ms (45µs+8.14) within Moose::Role::BEGIN@19 which was called: # once (45µs+8.14ms) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 19
use Moose::Util::TypeConstraints;
# spent 8.18ms making 1 call to Moose::Role::BEGIN@19 # spent 8.14ms 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 5.93s (4.33ms+5.93) within Moose::Role::with which was called 138 times, avg 43.0ms/call: # 69 times (1.49ms+2.51s) by Moose::Role::with at line 359 of Moose/Exporter.pm, avg 36.4ms/call # once (42µs+420ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@9 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/accessor.pm # once (40µs+313ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@9 at line 12 of Moose/Meta/Method/Accessor/Native/Array/accessor.pm # once (40µs+234ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 15 of Moose/Meta/Method/Accessor/Native/Hash/set.pm # once (40µs+176ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Moose/Meta/Method/Accessor/Native/Hash/Writer.pm # once (39µs+149ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Array/set.pm # once (40µs+110ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 of Markdent/Role/BlockParser.pm # once (42µs+88.1ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Array/Writer.pm # once (42µs+75.5ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 20 of Markdent/Role/HTMLStream.pm # once (41µs+66.4ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Moose/Meta/Method/Accessor/Native/Hash/get.pm # once (38µs+60.3ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 of Markdent/Role/AnyParser.pm # once (40µs+53.7ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@17 at line 14 of Moose/Meta/Method/Accessor/Native/String/substr.pm # once (39µs+51.5ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/delete.pm # once (41µs+49.3ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 23 of Moose/Meta/Attribute/Native/Trait/Hash.pm # once (40µs+47.0ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@23 at line 12 of Moose/Meta/Method/Accessor/Native/Array/push.pm # once (40µs+46.7ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@30 at line 14 of Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm # once (38µs+46.7ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@32 at line 12 of Moose/Meta/Method/Accessor/Native/Array/unshift.pm # once (41µs+46.0ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@10 at line 12 of Moose/Meta/Method/Accessor/Native/Array/clear.pm # once (40µs+45.8ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@22 at line 12 of Moose/Meta/Method/Accessor/Native/Array/pop.pm # once (41µs+45.3ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@26 at line 12 of Moose/Meta/Method/Accessor/Native/Array/shift.pm # once (40µs+45.1ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@28 at line 12 of Moose/Meta/Method/Accessor/Native/Array/splice.pm # once (39µs+44.5ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@17 at line 12 of Moose/Meta/Method/Accessor/Native/Array/insert.pm # once (41µs+42.8ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@13 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/delete.pm # once (42µs+42.1ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@10 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/clear.pm # once (40µs+40.7ms) by Moose::Meta::Attribute::Native::Trait::Counter::BEGIN@10 at line 12 of Moose/Meta/Method/Accessor/Native/Counter/inc.pm # once (42µs+38.3ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Moose/Meta/Method/Accessor/Native/Writer.pm # once (48µs+37.5ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Markdent/Role/EventsAsMethods.pm # once (43µs+37.2ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@11 at line 12 of Moose/Meta/Method/Accessor/Native/String/clear.pm # once (40µs+34.4ms) by Moose::Meta::Attribute::Native::Trait::Counter::BEGIN@11 at line 12 of Moose/Meta/Method/Accessor/Native/Counter/reset.pm # once (39µs+34.1ms) by Moose::Meta::Attribute::Native::Trait::Bool::BEGIN@10 at line 12 of Moose/Meta/Method/Accessor/Native/Bool/toggle.pm # once (41µs+33.0ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/String/inc.pm # once (39µs+32.9ms) by Moose::Meta::Attribute::Native::Trait::Bool::BEGIN@11 at line 12 of Moose/Meta/Method/Accessor/Native/Bool/unset.pm # once (40µs+32.9ms) by Moose::Meta::Attribute::Native::Trait::Counter::BEGIN@9 at line 12 of Moose/Meta/Method/Accessor/Native/Counter/dec.pm # once (40µs+32.9ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@10 at line 12 of Moose/Meta/Method/Accessor/Native/String/chop.pm # once (38µs+32.8ms) by Moose::Meta::Attribute::Native::Trait::Bool::BEGIN@9 at line 12 of Moose/Meta/Method/Accessor/Native/Bool/set.pm # once (39µs+32.8ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@9 at line 12 of Moose/Meta/Method/Accessor/Native/String/chomp.pm # once (40µs+32.5ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@15 at line 12 of Moose/Meta/Method/Accessor/Native/String/prepend.pm # once (40µs+32.5ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@8 at line 12 of Moose/Meta/Method/Accessor/Native/String/append.pm # once (40µs+32.3ms) by Moose::Meta::Attribute::Native::Trait::Counter::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Counter/set.pm # once (41µs+31.4ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@15 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/exists.pm # once (40µs+31.3ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@16 at line 15 of Moose/Meta/Method/Accessor/Native/String/replace.pm # once (41µs+31.0ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Moose/Meta/Method/Accessor/Native/Array/get.pm # once (41µs+30.5ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@12 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/defined.pm # once (51µs+22.4ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@14 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/elements.pm # once (39µs+19.9ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@27 at line 14 of Moose/Meta/Method/Accessor/Native/Array/shuffle.pm # once (43µs+19.5ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@13 at line 12 of Moose/Meta/Method/Accessor/Native/String/length.pm # once (39µs+19.5ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@31 at line 14 of Moose/Meta/Method/Accessor/Native/Array/uniq.pm # once (39µs+19.5ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@13 at line 12 of Moose/Meta/Method/Accessor/Native/Array/elements.pm # once (39µs+19.4ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@11 at line 12 of Moose/Meta/Method/Accessor/Native/Array/count.pm # once (41µs+19.4ms) by Moose::Meta::Attribute::Native::Trait::Bool::BEGIN@8 at line 12 of Moose/Meta/Method/Accessor/Native/Bool/not.pm # once (75µs+19.4ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@11 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/count.pm # once (42µs+19.4ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@18 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/keys.pm # once (41µs+19.4ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@19 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/kv.pm # once (40µs+19.3ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@18 at line 12 of Moose/Meta/Method/Accessor/Native/Array/is_empty.pm # once (42µs+19.3ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@17 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm # once (41µs+19.2ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@21 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/values.pm # once (40µs+18.9ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@14 at line 15 of Moose/Meta/Method/Accessor/Native/Array/first.pm # once (39µs+18.7ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@29 at line 14 of Moose/Meta/Method/Accessor/Native/Array/sort.pm # once (39µs+18.0ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@19 at line 14 of Moose/Meta/Method/Accessor/Native/Array/join.pm # once (39µs+17.9ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@24 at line 15 of Moose/Meta/Method/Accessor/Native/Array/reduce.pm # once (39µs+17.9ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@16 at line 14 of Moose/Meta/Method/Accessor/Native/Array/grep.pm # once (40µs+17.8ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@20 at line 14 of Moose/Meta/Method/Accessor/Native/Array/map.pm # once (40µs+17.7ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@14 at line 15 of Moose/Meta/Method/Accessor/Native/String/match.pm # once (39µs+17.0ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@21 at line 15 of Moose/Meta/Method/Accessor/Native/Array/natatime.pm # once (42µs+14.1ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Reader.pm # once (44µs+12.3ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 19 of Moose/Meta/Attribute/Native/Trait/String.pm # once (38µs+12.1ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 34 of Moose/Meta/Attribute/Native/Trait/Array.pm # once (38µs+12.1ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 13 of Moose/Meta/Attribute/Native/Trait/Bool.pm # once (40µs+11.5ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Moose/Meta/Attribute/Native/Trait/Counter.pm # once (49µs+11.1ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 of Markdent/Role/SpanParser.pm
sub with {
26691.39ms692.32s Moose::Util::apply_all_roles( shift, @_ );
# spent 3.41s making 69 calls to Moose::Util::apply_all_roles, avg 49.4ms/call, recursion: max depth 3, sum of overlapping time 1.09s
27}
28
29
# spent 6.16ms (619µs+5.54) within Moose::Role::requires which was called 18 times, avg 342µs/call: # 9 times (260µs+2.38ms) by Moose::Role::requires at line 359 of Moose/Exporter.pm, avg 294µs/call # once (46µs+529µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 of Markdent/Role/Handler.pm # once (37µs+442µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 22 of Markdent/Role/HTMLStream.pm # once (41µs+386µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (43µs+347µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 13 of Moose/Meta/Attribute/Native/Trait.pm # once (39µs+300µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 of Markdent/Role/EventAsText.pm # once (39µs+293µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Markdent/Role/SpanParser.pm # once (39µs+287µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Moose/Meta/Method/Accessor/Native/Reader.pm # once (38µs+288µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 16 of Moose/Meta/Method/Accessor/Native/Writer.pm # once (37µs+287µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Markdent/Role/BlockParser.pm
sub requires {
3027271µs my $meta = shift;
31 croak "Must specify at least one method" unless @_;
3292.38ms $meta->add_required_methods(@_);
# spent 2.38ms making 9 calls to Moose::Meta::Role::add_required_methods, avg 265µ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 12.3ms (1.08+11.2) within Moose::Role::has which was called 18 times, avg 684µs/call: # 9 times (728µs+5.03ms) by Moose::Role::has at line 359 of Moose/Exporter.pm, avg 639µs/call # once (47µs+915µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 24 of Markdent/Role/HTMLStream.pm # once (40µs+774µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 15 of Moose/Meta/Attribute/Native/Trait.pm # once (40µs+683µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Markdent/Role/DebugPrinter.pm # once (39µs+672µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 8 of MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm # once (41µs+648µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of Markdent/Role/AnyParser.pm # once (41µs+644µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 16 of Markdent/Role/BlockParser.pm # once (36µs+634µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 37 of Markdent/Role/HTMLStream.pm # once (37µs+631µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 190 of Moose/Meta/Attribute/Native/Trait.pm # once (34µs+603µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 14 of MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm
sub has {
4263681µs my $meta = shift;
43 my $name = shift;
44 croak 'Usage: has \'name\' => ( key => value, ... )' if @_ == 1;
459371µs my %options = ( definition_context => Moose::Util::_caller_info(), @_ );
# spent 371µs making 9 calls to Moose::Util::_caller_info, avg 41µs/call
46 my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];
4794.65ms $meta->add_attribute( $_, %options ) for @$attrs;
# spent 4.65ms making 9 calls to Moose::Meta::Role::add_attribute, avg 517µs/call
48}
49
50
# spent 3.79ms (501µs+3.29) within Moose::Role::_add_method_modifier which was called 19 times, avg 199µs/call: # 14 times (364µs+2.36ms) by Moose::Role::around at line 66, avg 194µs/call # 3 times (83µs+569µs) by Moose::Role::before at line 62, avg 217µs/call # 2 times (54µs+362µs) by Moose::Role::after at line 64, avg 208µs/call
sub _add_method_modifier {
5176524µs my $type = shift;
52 my $meta = shift;
53
54 if ( ref($_[0]) eq 'Regexp' ) {
55 croak "Roles do not currently support regex "
56 . " references for $type method modifiers";
57 }
58
59193.29ms Moose::Util::add_method_modifier($meta, $type, \@_);
# spent 3.29ms making 19 calls to Moose::Util::add_method_modifier, avg 173µs/call
60}
61
62353µs3652µs
# spent 1.69ms (170µs+1.52) within Moose::Role::before which was called 6 times, avg 282µs/call: # 3 times (59µs+652µs) by Moose::Role::before at line 359 of Moose/Exporter.pm, avg 237µs/call # once (44µs+321µs) by MooseX::SemiAffordanceAccessor::BEGIN@12 at line 34 of MooseX/SemiAffordanceAccessor/Role/Attribute.pm # once (37µs+274µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 51 of Moose/Meta/Attribute/Native/Trait.pm # once (31µs+274µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 101 of Moose/Meta/Attribute/Native/Trait.pm
sub before { _add_method_modifier('before', @_) }
# spent 652µs making 3 calls to Moose::Role::_add_method_modifier, avg 217µs/call
63
64237µs2416µs
# spent 1.09ms (117µs+976µs) within Moose::Role::after which was called 4 times, avg 273µs/call: # 2 times (40µs+416µs) by Moose::Role::after at line 359 of Moose/Exporter.pm, avg 228µs/call # once (44µs+308µs) by MooseX::StrictConstructor::BEGIN@12 at line 30 of MooseX/StrictConstructor/Role/Object.pm # once (33µs+252µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 83 of Moose/Meta/Attribute/Native/Trait.pm
sub after { _add_method_modifier('after', @_) }
# spent 416µs making 2 calls to Moose::Role::_add_method_modifier, avg 208µs/call
65
6614220µs142.72ms
# spent 7.13ms (735µs+6.39) within Moose::Role::around which was called 28 times, avg 255µs/call: # 14 times (250µs+2.72ms) by Moose::Role::around at line 359 of Moose/Exporter.pm, avg 212µs/call # once (40µs+338µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 33 of Moose/Meta/Method/Accessor/Native.pm # once (47µs+308µs) by MooseX::StrictConstructor::BEGIN@13 at line 39 of MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm # once (36µs+281µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 27 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (37µs+275µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 41 of Moose/Meta/Method/Accessor/Native/Hash/set.pm # once (31µs+274µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 59 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (37µs+260µs) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@17 at line 48 of Moose/Meta/Method/Accessor/Native/Array/insert.pm # once (38µs+258µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 55 of Moose/Meta/Method/Accessor/Native/Array/set.pm # once (35µs+250µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 136 of Moose/Meta/Attribute/Native/Trait.pm # once (30µs+251µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 158 of Moose/Meta/Attribute/Native/Trait.pm # once (31µs+241µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 76 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (32µs+240µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 41 of Moose/Meta/Method/Accessor/Native.pm # once (30µs+237µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 128 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (30µs+235µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 145 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (30µs+221µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 78 of Moose/Meta/Method/Accessor/Native/Hash/set.pm
sub around { _add_method_modifier('around', @_) }
# spent 2.72ms making 14 calls to Moose::Role::_add_method_modifier, avg 194µs/call
67
68# see Moose.pm for discussion
69
# spent 7.40ms (667µs+6.74) within Moose::Role::super which was called 28 times, avg 264µs/call: # 14 times (316µs+4.11ms) by Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/Method/Accessor/Native.pm:136] at line 119 of Moose/Meta/Method/Accessor/Native.pm, avg 316µs/call # 14 times (351µs+2.62ms) by Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/Method/Accessor/Native.pm:106] at line 103 of Moose/Meta/Method/Accessor/Native.pm, avg 212µs/call
sub super {
7056598µs return unless $Moose::SUPER_BODY;
71286.74ms $Moose::SUPER_BODY->(@Moose::SUPER_ARGS);
# spent 4.11ms making 14 calls to Moose::Meta::Method::Accessor::_eval_environment, avg 294µs/call # spent 2.62ms making 14 calls to Moose::Meta::Method::Accessor::_inline_get, avg 187µs/call
72}
73
74
# spent 3.39ms (261µs+3.13) within Moose::Role::override which was called 8 times, avg 423µs/call: # 4 times (113µs+1.41ms) by Moose::Role::override at line 359 of Moose/Exporter.pm, avg 381µs/call # once (44µs+484µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 106 of Moose/Meta/Method/Accessor/Native.pm # once (40µs+475µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 154 of Moose/Meta/Method/Accessor/Native/Writer.pm # once (32µs+384µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 114 of Moose/Meta/Method/Accessor/Native.pm # once (31µs+374µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 136 of Moose/Meta/Method/Accessor/Native.pm
sub override {
7512110µs my $meta = shift;
76 my ( $name, $code ) = @_;
7741.41ms $meta->add_override_method_modifier( $name, $code );
# spent 1.41ms making 4 calls to Moose::Meta::Role::add_override_method_modifier, avg 352µs/call
78}
79
80sub inner {
81 croak "Roles cannot support 'inner'";
82}
83
84sub augment {
85 croak "Roles cannot support 'augment'";
86}
87
88135µs15.13msMoose::Exporter->setup_import_methods(
# spent 5.13ms 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 416ms (13.9+402) within Moose::Role::init_meta which was called 83 times, avg 5.01ms/call: # 81 times (13.4ms+381ms) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:456] at line 423 of Moose/Exporter.pm, avg 4.87ms/call # 2 times (468µs+21.1ms) by MooseX::Role::Parameterized::init_meta at line 49 of MooseX/Role/Parameterized.pm, avg 10.8ms/call
sub init_meta {
100132814.3ms shift;
101 my %args = @_;
102
103 my $role = $args{for_class};
104
105 unless ($role) {
106 require Moose;
107 Moose->throw_error("Cannot call init_meta without specifying a for_class");
108 }
109
110 my $metaclass = $args{metaclass} || "Moose::Meta::Role";
111 my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta';
112
11383908µs Moose->throw_error("The Metaclass $metaclass must be a subclass of Moose::Meta::Role.")
# spent 908µs making 83 calls to UNIVERSAL::isa, avg 11µs/call
114 unless $metaclass->isa('Moose::Meta::Role');
115
116 # make a subtype for each Moose role
11716675.8ms role_type $role unless find_type_constraint($role);
# spent 67.8ms making 83 calls to Moose::Util::TypeConstraints::role_type, avg 817µs/call # spent 7.96ms making 83 calls to Moose::Util::TypeConstraints::find_type_constraint, avg 96µs/call
118
119 my $meta;
120831.11ms if ( $meta = Class::MOP::get_metaclass_by_name($role) ) {
# spent 1.11ms making 83 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 {
1318371.6ms $meta = $metaclass->initialize($role);
# spent 71.6ms making 83 calls to Moose::Meta::Role::initialize, avg 862µs/call
132 }
133
134 if (defined $meta_name) {
135 # also check for inherited non moose 'meta' method?
1368334.4ms my $existing = $meta->get_method($meta_name);
# spent 34.4ms making 83 calls to Class::MOP::Mixin::HasMethods::get_method, avg 414µs/call
137 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 }
14683219ms $meta->_add_meta_method($meta_name);
# spent 219ms making 83 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 2.63ms/call
147 }
148
149 return $meta;
150}
151
152130µs1;
153
154__END__