| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Role.pm |
| Statements | Executed 1396 statements in 19.1ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 69 | 1 | 1 | 11.5ms | 364ms | Moose::Role::init_meta |
| 102 | 52 | 52 | 3.18ms | 4.87s | Moose::Role::with (recurses: max depth 3, inclusive time 793ms) |
| 30 | 16 | 16 | 1.03ms | 22.4ms | Moose::Role::requires |
| 14 | 8 | 5 | 959µs | 11.9ms | Moose::Role::has |
| 26 | 14 | 7 | 683µs | 6.64ms | Moose::Role::around |
| 16 | 3 | 1 | 429µs | 3.14ms | Moose::Role::_add_method_modifier |
| 8 | 5 | 3 | 240µs | 3.37ms | Moose::Role::override |
| 10 | 2 | 1 | 218µs | 1.74ms | Moose::Role::super |
| 4 | 3 | 2 | 117µs | 1.04ms | Moose::Role::before |
| 1 | 1 | 1 | 69µs | 88µs | Moose::Role::BEGIN@2 |
| 2 | 2 | 2 | 62µs | 538µs | Moose::Role::after |
| 1 | 1 | 1 | 59µs | 144µs | Moose::Role::BEGIN@3 |
| 1 | 1 | 1 | 43µs | 8.07ms | Moose::Role::BEGIN@19 |
| 1 | 1 | 1 | 40µs | 199µs | Moose::Role::BEGIN@5 |
| 1 | 1 | 1 | 38µs | 653µs | Moose::Role::BEGIN@8 |
| 1 | 1 | 1 | 36µs | 161µs | Moose::Role::BEGIN@6 |
| 1 | 1 | 1 | 34µs | 165µs | Moose::Role::BEGIN@17 |
| 1 | 1 | 1 | 24µs | 24µs | Moose::Role::BEGIN@14 |
| 1 | 1 | 1 | 23µs | 23µs | Moose::Role::BEGIN@18 |
| 1 | 1 | 1 | 18µs | 18µ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 | 95µs | 2 | 107µ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 # spent 88µs making 1 call to Moose::Role::BEGIN@2
# spent 19µs making 1 call to strict::import |
| 3 | 3 | 114µs | 2 | 229µ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 # spent 144µs making 1 call to Moose::Role::BEGIN@3
# spent 85µs making 1 call to warnings::import |
| 4 | |||||
| 5 | 3 | 104µs | 2 | 359µ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 # spent 199µs making 1 call to Moose::Role::BEGIN@5
# spent 160µs making 1 call to Exporter::import |
| 6 | 3 | 124µs | 2 | 287µ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 # spent 161µs making 1 call to Moose::Role::BEGIN@6
# spent 126µs making 1 call to Exporter::import |
| 7 | |||||
| 8 | 3 | 242µs | 2 | 1.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 # 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 | |||||
| 10 | 1 | 5µs | our $VERSION = '1.19'; | ||
| 11 | 1 | 72µs | $VERSION = eval $VERSION; # spent 13µs executing statements in string eval | ||
| 12 | 1 | 3µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 13 | |||||
| 14 | 3 | 84µs | 1 | 24µs | # spent 24µs within Moose::Role::BEGIN@14 which was called:
# once (24µs+0s) by KiokuDB::Backend::BEGIN@4 at line 14 # spent 24µs making 1 call to Moose::Role::BEGIN@14 |
| 15 | 3 | 79µs | 1 | 18µs | # spent 18µs within Moose::Role::BEGIN@15 which was called:
# once (18µs+0s) by KiokuDB::Backend::BEGIN@4 at line 15 # spent 18µs making 1 call to Moose::Role::BEGIN@15 |
| 16 | |||||
| 17 | 3 | 97µs | 2 | 296µ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 # spent 165µs making 1 call to Moose::Role::BEGIN@17
# spent 131µs making 1 call to Moose::Exporter::import |
| 18 | 3 | 88µs | 1 | 23µs | # spent 23µs within Moose::Role::BEGIN@18 which was called:
# once (23µs+0s) by KiokuDB::Backend::BEGIN@4 at line 18 # spent 23µs making 1 call to Moose::Role::BEGIN@18 |
| 19 | 3 | 2.58ms | 2 | 16.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 # 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 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 | ||||
| 26 | 51 | 1.11ms | 51 | 1.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 | ||||
| 30 | 15 | 47µs | my $meta = shift; | ||
| 31 | 15 | 36µs | croak "Must specify at least one method" unless @_; | ||
| 32 | 15 | 354µs | 15 | 10.0ms | $meta->add_required_methods(@_); # spent 10.0ms making 15 calls to Moose::Meta::Role::add_required_methods, avg 667µ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 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 | ||||
| 42 | 7 | 21µs | my $meta = shift; | ||
| 43 | 7 | 24µs | my $name = shift; | ||
| 44 | 7 | 19µs | croak 'Usage: has \'name\' => ( key => value, ... )' if @_ == 1; | ||
| 45 | 7 | 152µs | 7 | 297µs | my %options = ( definition_context => Moose::Util::_caller_info(), @_ ); # spent 297µs making 7 calls to Moose::Util::_caller_info, avg 42µs/call |
| 46 | 7 | 107µs | my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ]; | ||
| 47 | 14 | 318µs | 7 | 4.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 | ||||
| 51 | 16 | 49µs | my $type = shift; | ||
| 52 | 16 | 36µs | my $meta = shift; | ||
| 53 | |||||
| 54 | 16 | 48µs | if ( ref($_[0]) eq 'Regexp' ) { | ||
| 55 | croak "Roles do not currently support regex " | ||||
| 56 | . " references for $type method modifiers"; | ||||
| 57 | } | ||||
| 58 | |||||
| 59 | 16 | 310µs | 16 | 2.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 | |||||
| 62 | 2 | 38µs | 2 | 396µ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 # spent 396µs making 2 calls to Moose::Role::_add_method_modifier, avg 198µs/call |
| 63 | |||||
| 64 | 1 | 20µs | 1 | 205µ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 # spent 205µs making 1 call to Moose::Role::_add_method_modifier |
| 65 | |||||
| 66 | 13 | 212µs | 13 | 2.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 # 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 | ||||
| 70 | 10 | 22µs | return unless $Moose::SUPER_BODY; | ||
| 71 | 10 | 181µs | 10 | 1.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 | ||||
| 75 | 4 | 11µs | my $meta = shift; | ||
| 76 | 4 | 17µs | my ( $name, $code ) = @_; | ||
| 77 | 4 | 75µs | 4 | 1.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 | |||||
| 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 | 5.06ms | Moose::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 | ||||
| 100 | 69 | 187µs | shift; | ||
| 101 | 69 | 778µs | my %args = @_; | ||
| 102 | |||||
| 103 | 69 | 368µs | my $role = $args{for_class}; | ||
| 104 | |||||
| 105 | 69 | 132µs | unless ($role) { | ||
| 106 | require Moose; | ||||
| 107 | Moose->throw_error("Cannot call init_meta without specifying a for_class"); | ||||
| 108 | } | ||||
| 109 | |||||
| 110 | 69 | 253µs | my $metaclass = $args{metaclass} || "Moose::Meta::Role"; | ||
| 111 | 69 | 268µs | my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta'; | ||
| 112 | |||||
| 113 | 69 | 1.89ms | 69 | 715µ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 | ||||
| 117 | 69 | 1.73ms | 138 | 88.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 | |||||
| 119 | 69 | 147µs | my $meta; | ||
| 120 | 69 | 1.10ms | 69 | 866µ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 { | ||||
| 131 | 69 | 1.06ms | 69 | 48.5ms | $meta = $metaclass->initialize($role); # spent 48.5ms making 69 calls to Moose::Meta::Role::initialize, avg 702µs/call |
| 132 | } | ||||
| 133 | |||||
| 134 | 69 | 703µs | if (defined $meta_name) { | ||
| 135 | # also check for inherited non moose 'meta' method? | ||||
| 136 | 69 | 1.18ms | 69 | 29.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 |
| 137 | 69 | 148µ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 | 69 | 954µs | 69 | 185ms | $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 | |||||
| 149 | 69 | 1.23ms | return $meta; | ||
| 150 | } | ||||
| 151 | |||||
| 152 | 1 | 30µs | 1; | ||
| 153 | |||||
| 154 | __END__ |