← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/pan_genome_post_analysis
  Run on Fri Mar 27 11:43:32 2015
Reported on Fri Mar 27 11:46:06 2015

Filename/Users/ap13/perl5/lib/perl5/darwin-2level/Moose/Role.pm
StatementsExecuted 201 statements in 1.36ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
26144262µs2.66msMoose::Role::::has Moose::Role::has
311153µs4.76msMoose::Role::::init_meta Moose::Role::init_meta
11130µs52µsBio::Roary::ClustersRole::::BEGIN@1Bio::Roary::ClustersRole::BEGIN@1
11119µs37µsMoose::Role::::BEGIN@9 Moose::Role::BEGIN@9
11114µs74µsMoose::Role::::BEGIN@8 Moose::Role::BEGIN@8
11113µs23µsBio::Roary::ClustersRole::::BEGIN@2Bio::Roary::ClustersRole::BEGIN@2
11110µs155µsMoose::Role::::BEGIN@11 Moose::Role::BEGIN@11
1119µs6.19msMoose::Role::::BEGIN@18 Moose::Role::BEGIN@18
1119µs35µsMoose::Role::::BEGIN@16 Moose::Role::BEGIN@16
1119µs176µsMoose::Role::::BEGIN@14 Moose::Role::BEGIN@14
1116µs6µsMoose::Role::::BEGIN@17 Moose::Role::BEGIN@17
1116µs6µsMoose::Role::::BEGIN@6 Moose::Role::BEGIN@6
1115µs5µsMoose::Role::::BEGIN@7 Moose::Role::BEGIN@7
1114µs4µsMoose::Role::::BEGIN@13 Moose::Role::BEGIN@13
0000s0sMoose::Role::::_add_method_modifier Moose::Role::_add_method_modifier
0000s0sMoose::Role::::after Moose::Role::after
0000s0sMoose::Role::::around Moose::Role::around
0000s0sMoose::Role::::augment Moose::Role::augment
0000s0sMoose::Role::::before Moose::Role::before
0000s0sMoose::Role::::excludes Moose::Role::excludes
0000s0sMoose::Role::::extends Moose::Role::extends
0000s0sMoose::Role::::inner Moose::Role::inner
0000s0sMoose::Role::::override Moose::Role::override
0000s0sMoose::Role::::requires Moose::Role::requires
0000s0sMoose::Role::::super Moose::Role::super
0000s0sMoose::Role::::with Moose::Role::with
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1245µs275µs
# spent 52µs (30+23) within Bio::Roary::ClustersRole::BEGIN@1 which was called: # once (30µs+23µs) by Bio::Roary::ClustersRole::BEGIN@11 at line 1
use strict;
# spent 52µs making 1 call to Bio::Roary::ClustersRole::BEGIN@1 # spent 23µs making 1 call to strict::import
2258µs233µs
# spent 23µs (13+10) within Bio::Roary::ClustersRole::BEGIN@2 which was called: # once (13µs+10µs) by Bio::Roary::ClustersRole::BEGIN@11 at line 2
use warnings;
# spent 23µs making 1 call to Bio::Roary::ClustersRole::BEGIN@2 # spent 10µs making 1 call to warnings::import
3package Moose::Role;
41700nsour $VERSION = '2.1403';
5
6237µs16µs
# spent 6µs within Moose::Role::BEGIN@6 which was called: # once (6µs+0s) by Bio::Roary::ClustersRole::BEGIN@11 at line 6
use Scalar::Util ();
# spent 6µs making 1 call to Moose::Role::BEGIN@6
7232µs15µs
# spent 5µs within Moose::Role::BEGIN@7 which was called: # once (5µs+0s) by Bio::Roary::ClustersRole::BEGIN@11 at line 7
use Carp ();
# spent 5µs making 1 call to Moose::Role::BEGIN@7
8241µs2134µs
# spent 74µs (14+60) within Moose::Role::BEGIN@8 which was called: # once (14µs+60µs) by Bio::Roary::ClustersRole::BEGIN@11 at line 8
use Class::Load 'is_class_loaded';
# spent 74µs making 1 call to Moose::Role::BEGIN@8 # spent 60µs making 1 call to Exporter::import
9234µs255µs
# spent 37µs (19+18) within Moose::Role::BEGIN@9 which was called: # once (19µs+18µs) by Bio::Roary::ClustersRole::BEGIN@11 at line 9
use Module::Runtime 'module_notional_filename';
# spent 37µs making 1 call to Moose::Role::BEGIN@9 # spent 18µs making 1 call to Module::Runtime::import
10
11227µs2299µs
# spent 155µs (10+144) within Moose::Role::BEGIN@11 which was called: # once (10µs+144µs) by Bio::Roary::ClustersRole::BEGIN@11 at line 11
use Sub::Exporter;
# spent 155µs making 1 call to Moose::Role::BEGIN@11 # spent 144µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
12
13221µs14µs
# spent 4µs within Moose::Role::BEGIN@13 which was called: # once (4µs+0s) by Bio::Roary::ClustersRole::BEGIN@11 at line 13
use Moose ();
# spent 4µs making 1 call to Moose::Role::BEGIN@13
14228µs2344µs
# spent 176µs (9+167) within Moose::Role::BEGIN@14 which was called: # once (9µs+167µs) by Bio::Roary::ClustersRole::BEGIN@11 at line 14
use Moose::Util 'throw_exception';
# spent 176µs making 1 call to Moose::Role::BEGIN@14 # spent 167µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
15
16224µs262µs
# spent 35µs (9+26) within Moose::Role::BEGIN@16 which was called: # once (9µs+26µs) by Bio::Roary::ClustersRole::BEGIN@11 at line 16
use Moose::Exporter;
# spent 35µs making 1 call to Moose::Role::BEGIN@16 # spent 26µs making 1 call to Moose::Exporter::import
17221µs16µs
# spent 6µs within Moose::Role::BEGIN@17 which was called: # once (6µs+0s) by Bio::Roary::ClustersRole::BEGIN@11 at line 17
use Moose::Meta::Role;
# spent 6µs making 1 call to Moose::Role::BEGIN@17
182660µs212.4ms
# spent 6.19ms (9µs+6.18) within Moose::Role::BEGIN@18 which was called: # once (9µs+6.18ms) by Bio::Roary::ClustersRole::BEGIN@11 at line 18
use Moose::Util::TypeConstraints;
# spent 6.19ms making 1 call to Moose::Role::BEGIN@18 # spent 6.18ms making 1 call to Moose::Util::TypeConstraints::import
19
20sub extends {
21 throw_exception("RolesDoNotSupportExtends");
22}
23
24sub with {
25 Moose::Util::apply_all_roles( shift, @_ );
26}
27
28sub requires {
29 my $meta = shift;
30 throw_exception( MustSpecifyAtleastOneMethod => role_name => $meta->name ) unless @_;
31 $meta->add_required_methods(@_);
32}
33
34sub excludes {
35 my $meta = shift;
36 throw_exception( MustSpecifyAtleastOneRole => role_name => $meta->name ) unless @_;
37 $meta->add_excluded_roles(@_);
38}
39
40
# spent 2.66ms (262µs+2.40) within Moose::Role::has which was called 26 times, avg 102µs/call: # 13 times (186µs+1.06ms) by Moose::Role::has at line 419 of Moose/Exporter.pm, avg 96µs/call # once (11µs+209µs) by Module::Runtime::require_module at line 14 of lib/Bio/Roary/ClustersRole.pm # once (8µs+151µs) by Module::Runtime::require_module at line 13 of lib/Bio/Roary/ParseGFFAnnotationRole.pm # once (8µs+138µs) by Module::Runtime::require_module at line 14 of lib/Bio/Roary/JobRunner/Role.pm # once (5µs+99µs) by Module::Runtime::require_module at line 15 of lib/Bio/Roary/ParseGFFAnnotationRole.pm # once (5µs+87µs) by Module::Runtime::require_module at line 16 of lib/Bio/Roary/ParseGFFAnnotationRole.pm # once (5µs+86µs) by Module::Runtime::require_module at line 17 of lib/Bio/Roary/ParseGFFAnnotationRole.pm # once (5µs+86µs) by Module::Runtime::require_module at line 15 of lib/Bio/Roary/ClustersRole.pm # once (5µs+86µs) by Module::Runtime::require_module at line 15 of lib/Bio/Roary/JobRunner/Role.pm # once (5µs+81µs) by Module::Runtime::require_module at line 16 of lib/Bio/Roary/JobRunner/Role.pm # once (5µs+81µs) by Module::Runtime::require_module at line 16 of lib/Bio/Roary/ClustersRole.pm # once (5µs+80µs) by Module::Runtime::require_module at line 17 of lib/Bio/Roary/JobRunner/Role.pm # once (4µs+79µs) by Module::Runtime::require_module at line 18 of lib/Bio/Roary/JobRunner/Role.pm # once (5µs+78µs) by Module::Runtime::require_module at line 19 of lib/Bio/Roary/JobRunner/Role.pm
sub has {
41133µs my $meta = shift;
42132µs my $name = shift;
43133µs throw_exception( InvalidHasProvidedInARole => role_name => $meta->name,
44 attribute_name => $name,
45 )
46 if @_ == 1;
471327µs1392µs my %context = Moose::Util::_caller_info;
# spent 92µs making 13 calls to Moose::Util::_caller_info, avg 7µs/call
48137µs $context{context} = 'has declaration';
49135µs $context{type} = 'role';
501323µs my %options = ( definition_context => \%context, @_ );
511310µs my $attrs = ( ref($name) eq 'ARRAY' ) ? $name : [ ($name) ];
521381µs13968µs $meta->add_attribute( $_, %options ) for @$attrs;
# spent 968µs making 13 calls to Moose::Meta::Role::add_attribute, avg 74µs/call
53}
54
55sub _add_method_modifier {
56 my $type = shift;
57 my $meta = shift;
58
59 if ( ref($_[0]) eq 'Regexp' ) {
60 throw_exception( RolesDoNotSupportRegexReferencesForMethodModifiers => modifier_type => $type,
61 role_name => $meta->name,
62 );
63 }
64
65 Moose::Util::add_method_modifier($meta, $type, \@_);
66}
67
68sub before { _add_method_modifier('before', @_) }
69
70sub after { _add_method_modifier('after', @_) }
71
72sub around { _add_method_modifier('around', @_) }
73
74# see Moose.pm for discussion
75sub super {
76 return unless $Moose::SUPER_BODY;
77 $Moose::SUPER_BODY->(@Moose::SUPER_ARGS);
78}
79
80sub override {
81 my $meta = shift;
82 my ( $name, $code ) = @_;
83 $meta->add_override_method_modifier( $name, $code );
84}
85
86sub inner {
87 throw_exception("RolesDoNotSupportInner");
88}
89
90sub augment {
91 throw_exception("RolesDoNotSupportAugment");
92}
93
9417µs1952µsMoose::Exporter->setup_import_methods(
# spent 952µs making 1 call to Moose::Exporter::setup_import_methods
95 with_meta => [
96 qw( with requires excludes has before after around override )
97 ],
98 as_is => [
99 qw( extends super inner augment ),
100 'Carp::confess',
101 'Scalar::Util::blessed',
102 ],
103);
104
105
# spent 4.76ms (153µs+4.60) within Moose::Role::init_meta which was called 3 times, avg 1.59ms/call: # 3 times (153µs+4.60ms) by Moose::Role::import at line 484 of Moose/Exporter.pm, avg 1.59ms/call
sub init_meta {
1063400ns shift;
10738µs my %args = @_;
108
10932µs my $role = $args{for_class};
110
1113500ns unless ($role) {
112 require Moose;
113 throw_exception( InitMetaRequiresClass => params => \%args );
114 }
115
11631µs my $metaclass = $args{metaclass} || "Moose::Meta::Role";
11732µs my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta';
118
119320µs311µs throw_exception( MetaclassNotLoaded => class_name => $metaclass )
# spent 11µs making 3 calls to Class::Load::XS::is_class_loaded, avg 4µs/call
120 unless is_class_loaded($metaclass);
121
122327µs35µs throw_exception( MetaclassMustBeASubclassOfMooseMetaRole => role_name => $metaclass )
# spent 5µs making 3 calls to UNIVERSAL::isa, avg 2µs/call
123 unless $metaclass->isa('Moose::Meta::Role');
124
125 # make a subtype for each Moose role
126313µs62.20ms role_type $role unless find_type_constraint($role);
# spent 2.13ms making 3 calls to Moose::Util::TypeConstraints::role_type, avg 710µs/call # spent 67µs making 3 calls to Moose::Util::TypeConstraints::find_type_constraint, avg 22µs/call
127
1283700ns my $meta;
12937µs36µs if ( $meta = Class::MOP::get_metaclass_by_name($role) ) {
# spent 6µs making 3 calls to Class::MOP::get_metaclass_by_name, avg 2µs/call
130 unless ( $meta->isa("Moose::Meta::Role") ) {
131 if ( $meta->isa('Moose::Meta::Class') ) {
132 throw_exception( MetaclassIsAClassNotASubclassOfGivenMetaclass => class_name => $role,
133 metaclass => $metaclass,
134 );
135 } else {
136 throw_exception( MetaclassIsNotASubclassOfGivenMetaclass => class_name => $role,
137 metaclass => $metaclass,
138 );
139 }
140 }
141 }
142 else {
143314µs3523µs $meta = $metaclass->initialize($role);
# spent 523µs making 3 calls to Moose::Meta::Role::initialize, avg 174µs/call
144319µs682µs my $filename = module_notional_filename($meta->name);
# spent 79µs making 3 calls to Module::Runtime::module_notional_filename, avg 26µs/call # spent 3µs making 3 calls to Class::MOP::Package::name, avg 1µs/call
14532µs $INC{$filename} = '(set by Moose)'
146 unless exists $INC{$filename};
147 }
148
14933µs if (defined $meta_name) {
150 # also check for inherited non moose 'meta' method?
151311µs3179µs my $existing = $meta->get_method($meta_name);
# spent 179µs making 3 calls to Class::MOP::Mixin::HasMethods::get_method, avg 60µs/call
1523500ns if ($existing && !$existing->isa('Class::MOP::Method::Meta')) {
153 Carp::cluck "Moose::Role is overwriting an existing method named "
154 . "$meta_name in role $role with a method "
155 . "which returns the class's metaclass. If this is "
156 . "actually what you want, you should remove the "
157 . "existing method, otherwise, you should rename or "
158 . "disable this generated method using the "
159 . "'-meta_name' option to 'use Moose::Role'.";
160 }
161310µs31.60ms $meta->_add_meta_method($meta_name);
# spent 1.60ms making 3 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 534µs/call
162 }
163
164311µs return $meta;
165}
166
16718µs1;
168
169# ABSTRACT: The Moose Role
170
171__END__