← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:39:01 2010
Reported on Wed Nov 17 22:07:57 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Role.pm
StatementsExecuted 1396 statements in 19.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
691111.5ms364msMoose::Role::::init_metaMoose::Role::init_meta
10252523.18ms4.87sMoose::Role::::withMoose::Role::with (recurses: max depth 3, inclusive time 793ms)
3016161.03ms22.4msMoose::Role::::requiresMoose::Role::requires
1485959µs11.9msMoose::Role::::hasMoose::Role::has
26147683µs6.64msMoose::Role::::aroundMoose::Role::around
1631429µs3.14msMoose::Role::::_add_method_modifierMoose::Role::_add_method_modifier
853240µs3.37msMoose::Role::::overrideMoose::Role::override
1021218µs1.74msMoose::Role::::superMoose::Role::super
432117µs1.04msMoose::Role::::beforeMoose::Role::before
11169µs88µsMoose::Role::::BEGIN@2Moose::Role::BEGIN@2
22262µs538µsMoose::Role::::afterMoose::Role::after
11159µs144µsMoose::Role::::BEGIN@3Moose::Role::BEGIN@3
11143µs8.07msMoose::Role::::BEGIN@19Moose::Role::BEGIN@19
11140µs199µsMoose::Role::::BEGIN@5Moose::Role::BEGIN@5
11138µs653µsMoose::Role::::BEGIN@8Moose::Role::BEGIN@8
11136µs161µsMoose::Role::::BEGIN@6Moose::Role::BEGIN@6
11134µs165µsMoose::Role::::BEGIN@17Moose::Role::BEGIN@17
11124µs24µsMoose::Role::::BEGIN@14Moose::Role::BEGIN@14
11123µs23µsMoose::Role::::BEGIN@18Moose::Role::BEGIN@18
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;
2395µs2107µs
# spent 88µs (69+19) within Moose::Role::BEGIN@2 which was called: # once (69µs+19µs) by KiokuDB::Backend::BEGIN@4 at line 2
use strict;
# spent 88µs making 1 call to Moose::Role::BEGIN@2 # spent 19µs making 1 call to strict::import
33114µs2229µs
# spent 144µs (59+85) within Moose::Role::BEGIN@3 which was called: # once (59µs+85µs) by KiokuDB::Backend::BEGIN@4 at line 3
use warnings;
# spent 144µs making 1 call to Moose::Role::BEGIN@3 # spent 85µs making 1 call to warnings::import
4
53104µs2359µs
# spent 199µs (40+160) within Moose::Role::BEGIN@5 which was called: # once (40µs+160µs) by KiokuDB::Backend::BEGIN@4 at line 5
use Scalar::Util 'blessed';
# spent 199µs making 1 call to Moose::Role::BEGIN@5 # spent 160µs making 1 call to Exporter::import
63124µs2287µs
# spent 161µs (36+126) within Moose::Role::BEGIN@6 which was called: # once (36µs+126µs) by KiokuDB::Backend::BEGIN@4 at line 6
use Carp 'croak';
# spent 161µs making 1 call to Moose::Role::BEGIN@6 # spent 126µs making 1 call to Exporter::import
7
83242µs21.27ms
# spent 653µs (38+615) within Moose::Role::BEGIN@8 which was called: # once (38µs+615µs) by KiokuDB::Backend::BEGIN@4 at line 8
use Sub::Exporter;
# spent 653µs making 1 call to Moose::Role::BEGIN@8 # spent 615µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
9
1015µsour $VERSION = '1.19';
11172µs$VERSION = eval $VERSION;
# spent 13µs executing statements in string eval
1213µsour $AUTHORITY = 'cpan:STEVAN';
13
14384µs124µs
# spent 24µs within Moose::Role::BEGIN@14 which was called: # once (24µs+0s) by KiokuDB::Backend::BEGIN@4 at line 14
use Moose ();
# spent 24µs making 1 call to Moose::Role::BEGIN@14
15379µ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
17397µs2296µs
# spent 165µs (34+131) within Moose::Role::BEGIN@17 which was called: # once (34µs+131µs) by KiokuDB::Backend::BEGIN@4 at line 17
use Moose::Exporter;
# spent 165µs making 1 call to Moose::Role::BEGIN@17 # spent 131µs making 1 call to Moose::Exporter::import
18388µs123µs
# spent 23µs within Moose::Role::BEGIN@18 which was called: # once (23µs+0s) by KiokuDB::Backend::BEGIN@4 at line 18
use Moose::Meta::Role;
# spent 23µs making 1 call to Moose::Role::BEGIN@18
1932.58ms216.1ms
# spent 8.07ms (43µs+8.03) within Moose::Role::BEGIN@19 which was called: # once (43µs+8.03ms) by KiokuDB::Backend::BEGIN@4 at line 19
use Moose::Util::TypeConstraints;
# 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
21sub extends {
22 croak "Roles do not support 'extends' (you can use 'with' to specialize a role)";
23}
24
25
# spent 4.87s (3.18ms+4.87) within Moose::Role::with which was called 102 times, avg 47.8ms/call: # 51 times (1.08ms+2.04s) by Moose::Role::with at line 359 of Moose/Exporter.pm, avg 40.0ms/call # once (40µs+417ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@9 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/accessor.pm # once (38µs+297ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@9 at line 12 of Moose/Meta/Method/Accessor/Native/Array/accessor.pm # once (38µs+231ms) 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 (37µs+173ms) 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 (51µs+159ms) 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 10 of KiokuDB/TypeMap/Entry/Std.pm # once (39µs+148ms) 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 (47µs+86.2ms) 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 (40µs+73.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 (38µs+68.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 (45µs+49.4ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@30 at line 14 of Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm # once (39µs+47.7ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@32 at line 12 of Moose/Meta/Method/Accessor/Native/Array/unshift.pm # once (39µs+46.9ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/delete.pm # once (39µs+46.4ms) 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.1ms) 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 (39µs+45.5ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@13 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/delete.pm # once (69µs+45.5ms) by MooseX::Clone::BEGIN@10 at line 10 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm # once (39µs+45.4ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@26 at line 12 of Moose/Meta/Method/Accessor/Native/Array/shift.pm # once (39µs+45.1ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@17 at line 12 of Moose/Meta/Method/Accessor/Native/Array/insert.pm # once (40µs+44.4ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@28 at line 12 of Moose/Meta/Method/Accessor/Native/Array/splice.pm # once (39µs+41.8ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@10 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/clear.pm # once (58µs+41.7ms) 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 17 of KiokuDB/Role/UUIDs.pm # once (37µs+40.6ms) by MooseX::Clone::BEGIN@11 at line 10 of MooseX/Clone/Meta/Attribute/Trait/StorableClone.pm # once (39µ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 (39µs+37.7ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@12 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/defined.pm # once (38µ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 (43µs+30.9ms) 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 (55µs+28.0ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@16 at line 14 of Moose/Meta/Method/Accessor/Native/Array/grep.pm # once (49µs+26.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 6 of KiokuDB/Error.pm # once (40µs+20.5ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@13 at line 12 of Moose/Meta/Method/Accessor/Native/Array/elements.pm # once (40µs+20.1ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@18 at line 12 of Moose/Meta/Method/Accessor/Native/Array/is_empty.pm # once (40µs+19.8ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@11 at line 12 of Moose/Meta/Method/Accessor/Native/Array/count.pm # once (39µs+19.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.3ms) 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.3ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@27 at line 14 of Moose/Meta/Method/Accessor/Native/Array/shuffle.pm # once (38µs+19.3ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@11 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/count.pm # once (39µ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 (38µs+19.2ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@17 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm # once (39µs+19.1ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@18 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/keys.pm # once (38µs+19.0ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@19 at line 14 of Moose/Meta/Method/Accessor/Native/Hash/kv.pm # once (39µs+18.8ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@29 at line 14 of Moose/Meta/Method/Accessor/Native/Array/sort.pm # once (57µs+18.0ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@14 at line 15 of Moose/Meta/Method/Accessor/Native/Array/first.pm # once (40µ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 (38µ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 (39µs+17.7ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@19 at line 14 of Moose/Meta/Method/Accessor/Native/Array/join.pm # once (39µs+16.9ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@21 at line 15 of Moose/Meta/Method/Accessor/Native/Array/natatime.pm # once (40µs+14.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 12 of Moose/Meta/Method/Accessor/Native/Reader.pm # once (39µs+12.2ms) 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 (36µs+3.22ms) by MooseX::Clone::BEGIN@12 at line 8 of MooseX/Clone/Meta/Attribute/Trait/NoClone.pm # once (40µs+3.15ms) 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 6 of MooseX/Clone/Meta/Attribute/Trait/Clone/Std.pm # once (35µs+3.15ms) by MooseX::Clone::BEGIN@13 at line 10 of MooseX/Clone/Meta/Attribute/Trait/Copy.pm
sub with {
26511.11ms511.72s Moose::Util::apply_all_roles( shift, @_ );
# spent 2.83s making 51 calls to Moose::Util::apply_all_roles, avg 55.5ms/call, recursion: max depth 3, sum of overlapping time 1.11s
27}
28
29
# spent 22.4ms (1.03+21.4) within Moose::Role::requires which was called 30 times, avg 747µs/call: # 15 times (447µs+10.0ms) by Moose::Role::requires at line 359 of Moose/Exporter.pm, avg 697µs/call # once (40µs+4.59ms) 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 6 of KiokuDB/Role/API.pm # once (49µs+1.17ms) 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 KiokuDB/TypeMap/Entry/Std/Compile.pm # once (44µs+1.01ms) by KiokuDB::BEGIN@10 at line 26 of KiokuDB/Backend.pm # once (37µs+628µ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 KiokuDB/TypeMap/Entry/Std/Expand.pm # once (36µs+469µs) by KiokuDB::TypeMap::BEGIN@9 at line 8 of KiokuDB/TypeMap/Entry.pm # once (36µs+452µ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+450µ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 Data/Stream/Bulk.pm # once (36µs+449µ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 KiokuDB/Error.pm # once (45µs+364µ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/Clone/Meta/Attribute/Trait/Clone/Base.pm # once (39µs+312µ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 (38µs+308µ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 (37µs+301µ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 KiokuDB/TypeMap/Entry/Std/Intrinsic.pm # once (36µs+294µ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 KiokuDB/Role/TypeMap.pm # once (36µs+282µ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 (34µ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 8 of MooseX/Clone/Meta/Attribute/Trait/Clone/Std.pm
sub requires {
301547µs my $meta = shift;
311536µs croak "Must specify at least one method" unless @_;
3215354µs1510.0ms $meta->add_required_methods(@_);
# spent 10.0ms making 15 calls to Moose::Meta::Role::add_required_methods, avg 667µ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 11.9ms (959µs+10.9) within Moose::Role::has which was called 14 times, avg 848µs/call: # 7 times (658µs+4.93ms) by Moose::Role::has at line 359 of Moose/Exporter.pm, avg 798µs/call # once (66µs+1.56ms) by MooseX::Clone::BEGIN@10 at line 14 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm # once (44µs+916µs) by MooseX::Clone::BEGIN@10 at line 20 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm # once (38µs+876µs) by MooseX::Clone::BEGIN@10 at line 30 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm # once (40µs+688µ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 10 of KiokuDB/TypeMap/Entry/Std/Intrinsic.pm # once (40µs+675µ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 Throwable.pm # once (37µs+654µ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 (35µs+617µ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
sub has {
42721µs my $meta = shift;
43724µs my $name = shift;
44719µs croak 'Usage: has \'name\' => ( key => value, ... )' if @_ == 1;
457152µs7297µs my %options = ( definition_context => Moose::Util::_caller_info(), @_ );
# spent 297µs making 7 calls to Moose::Util::_caller_info, avg 42µs/call
467107µs my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];
4714318µs74.63ms $meta->add_attribute( $_, %options ) for @$attrs;
# spent 4.63ms making 7 calls to Moose::Meta::Role::add_attribute, avg 662µs/call
48}
49
50
# spent 3.14ms (429µs+2.71) within Moose::Role::_add_method_modifier which was called 16 times, avg 196µs/call: # 13 times (351µs+2.19ms) by Moose::Role::around at line 66, avg 195µs/call # 2 times (52µs+344µs) by Moose::Role::before at line 62, avg 198µs/call # once (25µs+180µs) by Moose::Role::after at line 64
sub _add_method_modifier {
511649µs my $type = shift;
521636µs my $meta = shift;
53
541648µs if ( ref($_[0]) eq 'Regexp' ) {
55 croak "Roles do not currently support regex "
56 . " references for $type method modifiers";
57 }
58
5916310µs162.71ms Moose::Util::add_method_modifier($meta, $type, \@_);
# spent 2.71ms making 16 calls to Moose::Util::add_method_modifier, avg 170µs/call
60}
61
62238µs2396µs
# spent 1.04ms (117µs+925µs) within Moose::Role::before which was called 4 times, avg 261µs/call: # 2 times (39µs+396µs) by Moose::Role::before at line 359 of Moose/Exporter.pm, avg 218µs/call # once (47µ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 51 of Moose/Meta/Attribute/Native/Trait.pm # once (31µs+242µ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 396µs making 2 calls to Moose::Role::_add_method_modifier, avg 198µs/call
63
64120µs1205µs
# spent 538µs (62+476) within Moose::Role::after which was called 2 times, avg 269µs/call: # once (41µs+271µ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 # once (21µs+205µs) by Moose::Role::after at line 359 of Moose/Exporter.pm
sub after { _add_method_modifier('after', @_) }
# spent 205µs making 1 call to Moose::Role::_add_method_modifier
65
6613212µs132.54ms
# spent 6.64ms (683µs+5.96) within Moose::Role::around which was called 26 times, avg 255µs/call: # 13 times (239µs+2.54ms) by Moose::Role::around at line 359 of Moose/Exporter.pm, avg 214µs/call # once (49µs+361µ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 (47µs+330µ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 (36µs+271µ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 (34µs+272µ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 (33µs+272µ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 (30µs+262µ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 (37µs+254µs) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@17 at line 48 of Moose/Meta/Method/Accessor/Native/Array/insert.pm # once (30µ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 158 of Moose/Meta/Attribute/Native/Trait.pm # once (29µs+236µ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+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 59 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (29µ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 76 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (29µs+234µ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 (29µs+217µ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.54ms making 13 calls to Moose::Role::_add_method_modifier, avg 195µs/call
67
68# see Moose.pm for discussion
69
# spent 1.74ms (218µs+1.52) within Moose::Role::super which was called 10 times, avg 174µs/call: # 5 times (114µs+898µs) 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 203µs/call # 5 times (104µs+626µs) 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 146µs/call
sub super {
701022µs return unless $Moose::SUPER_BODY;
7110181µs101.52ms $Moose::SUPER_BODY->(@Moose::SUPER_ARGS);
# spent 898µs making 5 calls to Moose::Meta::Method::Accessor::_inline_get, avg 180µs/call # spent 626µs making 5 calls to Moose::Meta::Method::Accessor::_eval_environment, avg 125µs/call
72}
73
74
# spent 3.37ms (240µs+3.13) within Moose::Role::override which was called 8 times, avg 421µs/call: # 4 times (107µs+1.42ms) by Moose::Role::override at line 359 of Moose/Exporter.pm, avg 383µs/call # once (40µs+488µ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 (33µs+439µ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 (30µs+401µ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 # once (30µs+380µ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
sub override {
75411µs my $meta = shift;
76417µs my ( $name, $code ) = @_;
77475µs41.42ms $meta->add_override_method_modifier( $name, $code );
# spent 1.42ms making 4 calls to Moose::Meta::Role::add_override_method_modifier, avg 356µs/call
78}
79
80sub inner {
81 croak "Roles cannot support 'inner'";
82}
83
84sub augment {
85 croak "Roles cannot support 'augment'";
86}
87
88134µs15.06msMoose::Exporter->setup_import_methods(
# spent 5.06ms 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 364ms (11.5+352) within Moose::Role::init_meta which was called 69 times, avg 5.27ms/call: # 69 times (11.5ms+352ms) 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 5.27ms/call
sub init_meta {
10069187µs shift;
10169778µs my %args = @_;
102
10369368µs my $role = $args{for_class};
104
10569132µs unless ($role) {
106 require Moose;
107 Moose->throw_error("Cannot call init_meta without specifying a for_class");
108 }
109
11069253µs my $metaclass = $args{metaclass} || "Moose::Meta::Role";
11169268µs my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta';
112
113691.89ms69715µs Moose->throw_error("The Metaclass $metaclass must be a subclass of Moose::Meta::Role.")
# spent 715µs making 69 calls to UNIVERSAL::isa, avg 10µs/call
114 unless $metaclass->isa('Moose::Meta::Role');
115
116 # make a subtype for each Moose role
117691.73ms13888.1ms role_type $role unless find_type_constraint($role);
# spent 81.2ms making 69 calls to Moose::Util::TypeConstraints::role_type, avg 1.18ms/call # spent 6.93ms making 69 calls to Moose::Util::TypeConstraints::find_type_constraint, avg 100µs/call
118
11969147µs my $meta;
120691.10ms69866µs if ( $meta = Class::MOP::get_metaclass_by_name($role) ) {
# spent 866µs making 69 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 {
131691.06ms6948.5ms $meta = $metaclass->initialize($role);
# spent 48.5ms making 69 calls to Moose::Meta::Role::initialize, avg 702µs/call
132 }
133
13469703µs if (defined $meta_name) {
135 # also check for inherited non moose 'meta' method?
136691.18ms6929.2ms my $existing = $meta->get_method($meta_name);
# spent 29.2ms making 69 calls to Class::MOP::Mixin::HasMethods::get_method, avg 423µs/call
13769148µ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 }
14669954µs69185ms $meta->_add_meta_method($meta_name);
# spent 185ms making 69 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 2.68ms/call
147 }
148
149691.23ms return $meta;
150}
151
152130µs1;
153
154__END__