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

Filename/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm
StatementsExecuted 15830 statements in 163ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
661137.8ms303msMoose::Exporter::::__ANON__[:125]Moose::Exporter::__ANON__[:125]
4801126.8ms51.6msMoose::Exporter::::__ANON__[:329]Moose::Exporter::__ANON__[:329]
11123.6ms421msMoose::Exporter::::BEGIN@11Moose::Exporter::BEGIN@11
4801118.2ms18.2msMoose::Exporter::::_late_curry_wrapperMoose::Exporter::_late_curry_wrapper
66666216.1ms1.10sMoose::Exporter::::__ANON__[:456]Moose::Exporter::__ANON__[:456]
151110.0ms10.2msMoose::Exporter::::_remove_keywordsMoose::Exporter::_remove_keywords
175113.99ms10.5msMoose::Exporter::::__ANON__[:321]Moose::Exporter::__ANON__[:321]
1113.62ms4.67msMoose::Exporter::::BEGIN@13Moose::Exporter::BEGIN@13
412113.53ms3.53msMoose::Exporter::::__ANON__[:259]Moose::Exporter::__ANON__[:259]
66112.87ms4.06msMoose::Exporter::::_strip_traitsMoose::Exporter::_strip_traits
66112.41ms3.16msMoose::Exporter::::_strip_metaclassMoose::Exporter::_strip_metaclass
66112.11ms2.85msMoose::Exporter::::_strip_meta_nameMoose::Exporter::_strip_meta_name
3112.01ms3.61msMoose::Exporter::::_make_sub_exporter_paramsMoose::Exporter::_make_sub_exporter_params
39211.09ms1.09msMoose::Exporter::::_sub_from_packageMoose::Exporter::_sub_from_package
66111.04ms1.04msMoose::Exporter::::_get_callerMoose::Exporter::_get_caller
311921µs14.1msMoose::Exporter::::build_import_methodsMoose::Exporter::build_import_methods
11811846µs846µsMoose::Exporter::::_flag_as_reexportMoose::Exporter::_flag_as_reexport (xsub)
151514771µs11.0msMoose::Exporter::::__ANON__[:557]Moose::Exporter::__ANON__[:557]
1611401µs401µsMoose::Exporter::::_make_wrapped_sub_with_metaMoose::Exporter::_make_wrapped_sub_with_meta
311277µs277µsMoose::Exporter::::_make_init_metaMoose::Exporter::_make_init_meta
2811188µs188µsMoose::Exporter::::_export_is_flaggedMoose::Exporter::_export_is_flagged (xsub)
311188µs301µsMoose::Exporter::::_follow_alsoMoose::Exporter::_follow_also
333171µs14.3msMoose::Exporter::::setup_import_methodsMoose::Exporter::setup_import_methods
311159µs7.23msMoose::Exporter::::_make_exporterMoose::Exporter::_make_exporter
311156µs156µsMoose::Exporter::::_make_import_subMoose::Exporter::_make_import_sub
333154µs453µsMoose::Exporter::::importMoose::Exporter::import
31188µs88µsMoose::Exporter::::_make_unimport_subMoose::Exporter::_make_unimport_sub
31178µs78µsMoose::Exporter::::_parse_trait_aliasesMoose::Exporter::_parse_trait_aliases
11168µs772µsMoose::Exporter::::BEGIN@15Moose::Exporter::BEGIN@15
11163µs138µsMoose::Exporter::::BEGIN@120Moose::Exporter::BEGIN@120
11162µs79µsMoose::Exporter::::BEGIN@3Moose::Exporter::BEGIN@3
31162µs62µsMoose::Exporter::::_follow_also_realMoose::Exporter::_follow_also_real
11147µs123µsMoose::Exporter::::BEGIN@567Moose::Exporter::BEGIN@567
11145µs120µsMoose::Exporter::::BEGIN@272Moose::Exporter::BEGIN@272
11144µs220µsMoose::Exporter::::BEGIN@14Moose::Exporter::BEGIN@14
11144µs241µsMoose::Exporter::::BEGIN@12Moose::Exporter::BEGIN@12
11141µs198µsMoose::Exporter::::BEGIN@16Moose::Exporter::BEGIN@16
11139µs106µsMoose::Exporter::::BEGIN@4Moose::Exporter::BEGIN@4
11139µs104µsMoose::Exporter::::BEGIN@121Moose::Exporter::BEGIN@121
11136µs90µsMoose::Exporter::::BEGIN@577Moose::Exporter::BEGIN@577
11123µs23µsMoose::Exporter::::BEGIN@18Moose::Exporter::BEGIN@18
0000s0sMoose::Exporter::::__ANON__[:189]Moose::Exporter::__ANON__[:189]
0000s0sMoose::Exporter::::__ANON__[:307]Moose::Exporter::__ANON__[:307]
0000s0sMoose::Exporter::::__ANON__[:338]Moose::Exporter::__ANON__[:338]
0000s0sMoose::Exporter::::__ANON__[:360]Moose::Exporter::__ANON__[:360]
0000s0sMoose::Exporter::::__ANON__[:460]Moose::Exporter::__ANON__[:460]
0000s0sMoose::Exporter::::__ANON__[:474]Moose::Exporter::__ANON__[:474]
0000s0sMoose::Exporter::::__ANON__[:486]Moose::Exporter::__ANON__[:486]
0000s0sMoose::Exporter::::__ANON__[:643]Moose::Exporter::__ANON__[:643]
0000s0sMoose::Exporter::::_apply_meta_traitsMoose::Exporter::_apply_meta_traits
0000s0sMoose::Exporter::::_curry_wrapperMoose::Exporter::_curry_wrapper
0000s0sMoose::Exporter::::_make_wrapped_subMoose::Exporter::_make_wrapped_sub
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Exporter;
2
3397µs296µs
# spent 79µs (62+17) within Moose::Exporter::BEGIN@3 which was called: # once (62µs+17µs) by Moose::BEGIN@15 at line 3
use strict;
# spent 79µs making 1 call to Moose::Exporter::BEGIN@3 # spent 17µs making 1 call to strict::import
43252µs2173µs
# spent 106µs (39+67) within Moose::Exporter::BEGIN@4 which was called: # once (39µs+67µs) by Moose::BEGIN@15 at line 4
use warnings;
# spent 106µs making 1 call to Moose::Exporter::BEGIN@4 # spent 67µs making 1 call to warnings::import
5
615µsour $VERSION = '1.19';
713µsour $XS_VERSION = $VERSION;
8170µs$VERSION = eval $VERSION;
# spent 44µs executing statements in string eval
913µsour $AUTHORITY = 'cpan:STEVAN';
10
113492µs1421ms
# spent 421ms (23.6+398) within Moose::Exporter::BEGIN@11 which was called: # once (23.6ms+398ms) by Moose::BEGIN@15 at line 11
use Class::MOP;
# spent 421ms making 1 call to Moose::Exporter::BEGIN@11
123106µs2438µs
# spent 241µs (44+197) within Moose::Exporter::BEGIN@12 which was called: # once (44µs+197µs) by Moose::BEGIN@15 at line 12
use List::MoreUtils qw( first_index uniq );
# spent 241µs making 1 call to Moose::Exporter::BEGIN@12 # spent 197µs making 1 call to Exporter::import
133762µs14.67ms
# spent 4.67ms (3.62+1.05) within Moose::Exporter::BEGIN@13 which was called: # once (3.62ms+1.05ms) by Moose::BEGIN@15 at line 13
use Moose::Util::MetaRole;
# spent 4.67ms making 1 call to Moose::Exporter::BEGIN@13
143110µs2396µs
# spent 220µs (44+176) within Moose::Exporter::BEGIN@14 which was called: # once (44µs+176µs) by Moose::BEGIN@15 at line 14
use Scalar::Util qw(reftype);
# spent 220µs making 1 call to Moose::Exporter::BEGIN@14 # spent 176µs making 1 call to Exporter::import
153229µs31.48ms
# spent 772µs (68+704) within Moose::Exporter::BEGIN@15 which was called: # once (68µs+704µs) by Moose::BEGIN@15 at line 15
use Sub::Exporter 0.980;
# spent 772µs making 1 call to Moose::Exporter::BEGIN@15 # spent 646µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756] # spent 58µs making 1 call to UNIVERSAL::VERSION
163101µs2354µs
# spent 198µs (41+156) within Moose::Exporter::BEGIN@16 which was called: # once (41µs+156µs) by Moose::BEGIN@15 at line 16
use Sub::Name qw(subname);
# spent 198µs making 1 call to Moose::Exporter::BEGIN@16 # spent 156µs making 1 call to Exporter::import
17
1831.45ms123µs
# spent 23µs within Moose::Exporter::BEGIN@18 which was called: # once (23µs+0s) by Moose::BEGIN@15 at line 18
use XSLoader;
# spent 23µs making 1 call to Moose::Exporter::BEGIN@18
19
201234µs1204µsXSLoader::load( 'Moose', $XS_VERSION );
# spent 204µs making 1 call to XSLoader::load
21
2212µsmy %EXPORT_SPEC;
23
24
# spent 14.3ms (171µs+14.1) within Moose::Exporter::setup_import_methods which was called 3 times, avg 4.76ms/call: # once (61µs+5.28ms) by Moose::Meta::Attribute::BEGIN@20 at line 42 of Moose/Util/TypeConstraints.pm # once (53µs+4.62ms) by KiokuDB::Backend::BEGIN@4 at line 88 of Moose/Role.pm # once (57µs+4.21ms) by KiokuDB::BEGIN@4 at line 122 of Moose.pm
sub setup_import_methods {
25333µs my ( $class, %args ) = @_;
26
27326µs my $exporting_package = $args{exporting_package} ||= caller();
28
293116µs314.1ms $class->build_import_methods(
# spent 14.1ms making 3 calls to Moose::Exporter::build_import_methods, avg 4.70ms/call
30 %args,
31 install => [qw(import unimport init_meta)]
32 );
33}
34
35
# spent 14.1ms (921µs+13.2) within Moose::Exporter::build_import_methods which was called 3 times, avg 4.70ms/call: # 3 times (921µs+13.2ms) by Moose::Exporter::setup_import_methods at line 29, avg 4.70ms/call
sub build_import_methods {
36328µs my ( $class, %args ) = @_;
37
38311µs my $exporting_package = $args{exporting_package} ||= caller();
39
40316µs $EXPORT_SPEC{$exporting_package} = \%args;
41
42341µs3301µs my @exports_from = $class->_follow_also($exporting_package);
# spent 301µs making 3 calls to Moose::Exporter::_follow_also, avg 100µs/call
43
44312µs my $export_recorder = {};
4538µs my $is_reexport = {};
46
47352µs33.61ms my $exports = $class->_make_sub_exporter_params(
# spent 3.61ms making 3 calls to Moose::Exporter::_make_sub_exporter_params, avg 1.20ms/call
48 [ @exports_from, $exporting_package ],
49 $export_recorder,
50 $is_reexport,
51 );
52
53348µs37.23ms my $exporter = $class->_make_exporter($exports, $is_reexport);
# spent 7.23ms making 3 calls to Moose::Exporter::_make_exporter, avg 2.41ms/call
54
5536µs my %methods;
56360µs3156µs $methods{import} = $class->_make_import_sub(
# spent 156µs making 3 calls to Moose::Exporter::_make_import_sub, avg 52µs/call
57 $exporting_package,
58 $exporter,
59 \@exports_from,
60 $is_reexport
61 );
62
63349µs388µs $methods{unimport} = $class->_make_unimport_sub(
# spent 88µs making 3 calls to Moose::Exporter::_make_unimport_sub, avg 29µs/call
64 $exporting_package,
65 $exports,
66 $export_recorder,
67 $is_reexport
68 );
69
70345µs3277µs $methods{init_meta} = $class->_make_init_meta(
# spent 277µs making 3 calls to Moose::Exporter::_make_init_meta, avg 92µs/call
71 $exporting_package,
72 \%args
73 );
74
75350µs3509µs my $package = Class::MOP::Package->initialize($exporting_package);
# spent 509µs making 3 calls to Class::MOP::Package::initialize, avg 170µs/call
76336µs for my $to_install ( @{ $args{install} || [] } ) {
77934µs my $symbol = '&' . $to_install;
78 next
79994µs6535µs unless $methods{$to_install}
# spent 535µs making 6 calls to Class::MOP::Package::has_package_symbol, avg 89µs/call
80 && !$package->has_package_symbol($symbol);
81690µs6485µs $package->add_package_symbol( $symbol, $methods{$to_install} );
# spent 485µs making 6 calls to Class::MOP::Package::add_package_symbol, avg 81µs/call
82 }
83
84377µs return ( $methods{import}, $methods{unimport}, $methods{init_meta} );
85}
86
87
# spent 7.23ms (159µs+7.07) within Moose::Exporter::_make_exporter which was called 3 times, avg 2.41ms/call: # 3 times (159µs+7.07ms) by Moose::Exporter::build_import_methods at line 53, avg 2.41ms/call
sub _make_exporter {
88314µs my ($class, $exports, $is_reexport) = @_;
89
90 return Sub::Exporter::build_exporter(
91 {
92 exports => $exports,
93 groups => { default => [':all'] },
94
# spent 303ms (37.8+265) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:125] which was called 66 times, avg 4.58ms/call: # 66 times (37.8ms+265ms) by Sub::Exporter::_do_import at line 799 of Sub/Exporter.pm, avg 4.58ms/call
installer => sub {
9566268µs my ($arg, $to_export) = @_;
9666882µs662.56ms my $meta = Class::MOP::class_of($arg->{into});
# spent 2.56ms making 66 calls to Class::MOP::class_of, avg 39µs/call
97
9866194µs27.84ms goto &Sub::Exporter::default_installer unless $meta;
# spent 7.84ms making 2 calls to Sub::Exporter::default_installer, avg 3.92ms/call
99
100 # don't overwrite existing symbols with our magically flagged
101 # version of it if we would install the same sub that's already
102 # in the importer
103
10464132µs my @filtered_to_export;
10564120µs my %installed;
106644.76ms for (my $i = 0; $i < @{ $to_export }; $i += 2) {
1078584.14ms my ($as, $cv) = @{ $to_export }[$i, $i + 1];
108
10985811.3ms86052.6ms next if !ref($as)
# spent 52.5ms making 858 calls to Class::MOP::Package::has_package_symbol, avg 61µs/call # spent 118µs making 2 calls to Class::MOP::Package::get_package_symbol, avg 59µs/call
110 && $meta->has_package_symbol('&' . $as)
111 && $meta->get_package_symbol('&' . $as) == $cv;
112
1138563.37ms push @filtered_to_export, $as, $cv;
1148564.88ms $installed{$as} = 1 unless ref $as;
11564166µs }
116
11764825µs64209ms Sub::Exporter::default_installer($arg, \@filtered_to_export);
# spent 209ms making 64 calls to Sub::Exporter::default_installer, avg 3.26ms/call
118
119641.98ms for my $name ( keys %{$is_reexport} ) {
1203113µs2213µs
# spent 138µs (63+75) within Moose::Exporter::BEGIN@120 which was called: # once (63µs+75µs) by Moose::BEGIN@15 at line 120
no strict 'refs';
# spent 138µs making 1 call to Moose::Exporter::BEGIN@120 # spent 75µs making 1 call to strict::unimport
12132.50ms2169µs
# spent 104µs (39+65) within Moose::Exporter::BEGIN@121 which was called: # once (39µs+65µs) by Moose::BEGIN@15 at line 121
no warnings 'once';
# spent 104µs making 1 call to Moose::Exporter::BEGIN@121 # spent 65µs making 1 call to warnings::unimport
122120413µs next unless exists $installed{$name};
1231183.74ms118846µs _flag_as_reexport( \*{ join q{::}, $arg->{into}, $name } );
# spent 846µs making 118 calls to Moose::Exporter::_flag_as_reexport, avg 7µs/call
124 }
125 },
126 }
1273146µs37.07ms );
# spent 7.07ms making 3 calls to Sub::Exporter::build_exporter, avg 2.36ms/call
128}
129
130{
13129µs my $seen = {};
132
133
# spent 301µs (188+113) within Moose::Exporter::_follow_also which was called 3 times, avg 100µs/call: # 3 times (188µs+113µs) by Moose::Exporter::build_import_methods at line 42, avg 100µs/call
sub _follow_also {
134313µs my $class = shift;
13539µs my $exporting_package = shift;
136
137325µs local %$seen = ( $exporting_package => 1 );
138
1393154µs6113µs return uniq( _follow_also_real($exporting_package) );
# spent 62µs making 3 calls to Moose::Exporter::_follow_also_real, avg 21µs/call # spent 51µs making 3 calls to List::MoreUtils::uniq, avg 17µs/call
140 }
141
142
# spent 62µs within Moose::Exporter::_follow_also_real which was called 3 times, avg 21µs/call: # 3 times (62µs+0s) by Moose::Exporter::_follow_also at line 139, avg 21µs/call
sub _follow_also_real {
143310µs my $exporting_package = shift;
144
145312µs if ( !exists $EXPORT_SPEC{$exporting_package} ) {
146 my $loaded = Class::MOP::is_class_loaded($exporting_package);
147
148 die "Package in also ($exporting_package) does not seem to "
149 . "use Moose::Exporter"
150 . ( $loaded ? "" : " (is it loaded?)" );
151 }
152
153312µs my $also = $EXPORT_SPEC{$exporting_package}{also};
154
155376µs return unless defined $also;
156
157 my @also = ref $also ? @{$also} : $also;
158
159 for my $package (@also) {
160 die
161 "Circular reference in 'also' parameter to Moose::Exporter between $exporting_package and $package"
162 if $seen->{$package};
163
164 $seen->{$package} = 1;
165 }
166
167 return @also, map { _follow_also_real($_) } @also;
168 }
169}
170
171
# spent 78µs within Moose::Exporter::_parse_trait_aliases which was called 3 times, avg 26µs/call: # 3 times (78µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 233, avg 26µs/call
sub _parse_trait_aliases {
172311µs my $class = shift;
173318µs my ($package, $aliases) = @_;
174
17535µs my @ret;
176318µs for my $alias (@$aliases) {
177 my $name;
178 if (ref($alias)) {
179 reftype($alias) eq 'ARRAY'
180 or Moose->throw_error(reftype($alias) . " references are not "
181 . "valid arguments to the 'trait_aliases' "
182 . "option");
183
184 ($alias, $name) = @$alias;
185 }
186 else {
187 ($name = $alias) =~ s/.*:://;
188 }
189 push @ret, subname "${package}::${name}" => sub () { $alias };
190 }
191
192344µs return @ret;
193}
194
195
# spent 3.61ms (2.01+1.60) within Moose::Exporter::_make_sub_exporter_params which was called 3 times, avg 1.20ms/call: # 3 times (2.01ms+1.60ms) by Moose::Exporter::build_import_methods at line 47, avg 1.20ms/call
sub _make_sub_exporter_params {
196310µs my $class = shift;
19738µs my $packages = shift;
19836µs my $export_recorder = shift;
19937µs my $is_reexport = shift;
200
20136µs my %exports;
202
203321µs for my $package ( @{$packages} ) {
204310µs my $args = $EXPORT_SPEC{$package}
205 or die "The $package package does not use Moose::Exporter\n";
206
207321µs for my $name ( @{ $args->{with_meta} } ) {
20816173µs16430µs my $sub = $class->_sub_from_package( $package, $name )
# spent 430µs making 16 calls to Moose::Exporter::_sub_from_package, avg 27µs/call
209 or next;
210
2111656µs my $fq_name = $package . '::' . $name;
212
21316254µs16401µs $exports{$name} = $class->_make_wrapped_sub_with_meta(
# spent 401µs making 16 calls to Moose::Exporter::_make_wrapped_sub_with_meta, avg 25µs/call
214 $fq_name,
215 $sub,
216 $export_recorder,
217 );
218 }
219
220324µs for my $name ( @{ $args->{with_caller} } ) {
221 my $sub = $class->_sub_from_package( $package, $name )
222 or next;
223
224 my $fq_name = $package . '::' . $name;
225
226 $exports{$name} = $class->_make_wrapped_sub(
227 $fq_name,
228 $sub,
229 $export_recorder,
230 );
231 }
232
233353µs378µs my @extra_exports = $class->_parse_trait_aliases(
# spent 78µs making 3 calls to Moose::Exporter::_parse_trait_aliases, avg 26µs/call
234 $package, $args->{trait_aliases},
235 );
236334µs for my $name ( @{ $args->{as_is} }, @extra_exports ) {
2372753µs my ( $sub, $coderef_name );
238
23927102µs if ( ref $name ) {
24048µs $sub = $name;
241
24247µs my $coderef_pkg;
2434106µs436µs ( $coderef_pkg, $coderef_name )
# spent 36µs making 4 calls to Class::MOP::get_code_info, avg 9µs/call
244 = Class::MOP::get_code_info($name);
245
246424µs if ( $coderef_pkg ne $package ) {
247 $is_reexport->{$coderef_name} = 1;
248 }
249 }
250 else {
25123267µs23656µs $sub = $class->_sub_from_package( $package, $name )
# spent 656µs making 23 calls to Moose::Exporter::_sub_from_package, avg 29µs/call
252 or next;
253
2542366µs $coderef_name = $name;
255 }
256
25727149µs $export_recorder->{$sub} = 1;
258
2594394.99ms
# spent 3.53ms within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:259] which was called 412 times, avg 9µs/call: # 412 times (3.53ms+0s) by Sub::Exporter::default_generator at line 856 of Sub/Exporter.pm, avg 9µs/call
$exports{$coderef_name} = sub {$sub};
260 }
261 }
262
263354µs return \%exports;
264}
265
266
# spent 1.09ms within Moose::Exporter::_sub_from_package which was called 39 times, avg 28µs/call: # 23 times (656µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 251, avg 29µs/call # 16 times (430µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 208, avg 27µs/call
sub _sub_from_package {
26739107µs my $sclass = shift;
2683985µs my $package = shift;
2693985µs my $name = shift;
270
27139162µs my $sub = do {
27235.23ms2195µs
# spent 120µs (45+75) within Moose::Exporter::BEGIN@272 which was called: # once (45µs+75µs) by Moose::BEGIN@15 at line 272
no strict 'refs';
# spent 120µs making 1 call to Moose::Exporter::BEGIN@272 # spent 75µs making 1 call to strict::unimport
27339299µs \&{ $package . '::' . $name };
274 };
275
27639476µs return $sub if defined &$sub;
277
278 Carp::cluck "Trying to export undefined sub ${package}::${name}";
279
280 return;
281}
282
28312µsour $CALLER;
284
285sub _make_wrapped_sub {
286 my $self = shift;
287 my $fq_name = shift;
288 my $sub = shift;
289 my $export_recorder = shift;
290
291 # We need to set the package at import time, so that when
292 # package Foo imports has(), we capture "Foo" as the
293 # package. This lets other packages call Foo::has() and get
294 # the right package. This is done for backwards compatibility
295 # with existing production code, not because this is a good
296 # idea ;)
297 return sub {
298 my $caller = $CALLER;
299
300 my $wrapper = $self->_curry_wrapper( $sub, $fq_name, $caller );
301
302 my $sub = subname( $fq_name => $wrapper );
303
304 $export_recorder->{$sub} = 1;
305
306 return $sub;
307 };
308}
309
310
# spent 401µs within Moose::Exporter::_make_wrapped_sub_with_meta which was called 16 times, avg 25µs/call: # 16 times (401µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 213, avg 25µs/call
sub _make_wrapped_sub_with_meta {
3111653µs my $self = shift;
3121648µs my $fq_name = shift;
3131635µs my $sub = shift;
3141631µs my $export_recorder = shift;
315
316
# spent 51.6ms (26.8+24.8) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:329] which was called 480 times, avg 107µs/call: # 480 times (26.8ms+24.8ms) by Sub::Exporter::default_generator at line 856 of Sub/Exporter.pm, avg 107µs/call
return sub {
3174801.48ms my $caller = $CALLER;
318
319 my $wrapper = $self->_late_curry_wrapper(
320 $sub, $fq_name,
32165513.0ms65524.8ms
# spent 10.5ms (3.99+6.55) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:321] which was called 175 times, avg 60µs/call: # 175 times (3.99ms+6.55ms) by Moose::Role::after or Moose::Role::around or Moose::Role::before or Moose::Role::has or Moose::Role::override or Moose::Role::requires or Moose::Role::with or Moose::before or Moose::extends or Moose::has or Moose::with at line 358, avg 60µs/call
sub { Class::MOP::class_of(shift) } => $caller
# spent 18.2ms making 480 calls to Moose::Exporter::_late_curry_wrapper, avg 38µs/call # spent 6.55ms making 175 calls to Class::MOP::class_of, avg 37µs/call
322 );
323
32448012.1ms4806.52ms my $sub = subname( $fq_name => $wrapper );
# spent 6.52ms making 480 calls to Sub::Name::subname, avg 14µs/call
325
3264803.40ms $export_recorder->{$sub} = 1;
327
3284805.83ms return $sub;
32916288µs };
330}
331
332sub _curry_wrapper {
333 my $class = shift;
334 my $sub = shift;
335 my $fq_name = shift;
336 my @extra = @_;
337
338 my $wrapper = sub { $sub->( @extra, @_ ) };
339 if ( my $proto = prototype $sub ) {
340
341 # XXX - Perl's prototype sucks. Use & to make set_prototype
342 # ignore the fact that we're passing "private variables"
343 &Scalar::Util::set_prototype( $wrapper, $proto );
344 }
345 return $wrapper;
346}
347
348
# spent 18.2ms within Moose::Exporter::_late_curry_wrapper which was called 480 times, avg 38µs/call: # 480 times (18.2ms+0s) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:329] at line 321, avg 38µs/call
sub _late_curry_wrapper {
3494801.45ms my $class = shift;
3504801.17ms my $sub = shift;
3514801.12ms my $fq_name = shift;
352480988µs my $extra = shift;
3534802.42ms my @ex_args = @_;
354
355 my $wrapper = sub {
356
357 # resolve curried arguments at runtime via this closure
3581752.55ms17510.5ms my @curry = ( $extra->(@ex_args) );
# spent 10.5ms making 175 calls to Moose::Exporter::__ANON__[Moose/Exporter.pm:321], avg 60µs/call
3591755.04ms1753.87s return $sub->( @curry, @_ );
# spent 2.33s making 108 calls to Moose::has, avg 21.6ms/call # spent 950ms making 13 calls to Moose::with, avg 73.1ms/call, recursion: max depth 1, sum of overlapping time 26.4ms # spent 788ms making 18 calls to Moose::Role::with, avg 43.8ms/call, recursion: max depth 2, sum of overlapping time 194ms # spent 11.2ms making 15 calls to Moose::Role::requires, avg 747µs/call # spent 5.53ms making 1 call to Moose::extends # spent 4.23ms making 7 calls to Moose::Role::has, avg 604µs/call # spent 1.56ms making 1 call to Moose::before # spent 1.32ms making 6 calls to Moose::Role::around, avg 221µs/call # spent 760µs making 3 calls to Moose::Role::override, avg 253µs/call # spent 448µs making 2 calls to Moose::Role::before, avg 224µs/call # spent 224µs making 1 call to Moose::Role::after
3604805.45ms };
361
3624801.33ms if ( my $proto = prototype $sub ) {
363
364 # XXX - Perl's prototype sucks. Use & to make set_prototype
365 # ignore the fact that we're passing "private variables"
366 &Scalar::Util::set_prototype( $wrapper, $proto );
367 }
3684806.66ms return $wrapper;
369}
370
371
# spent 156µs within Moose::Exporter::_make_import_sub which was called 3 times, avg 52µs/call: # 3 times (156µs+0s) by Moose::Exporter::build_import_methods at line 56, avg 52µs/call
sub _make_import_sub {
37239µs shift;
373313µs my $exporting_package = shift;
37438µs my $exporter = shift;
37537µs my $exports_from = shift;
37637µs my $is_reexport = shift;
377
378
# spent 1.10s (16.1ms+1.09) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] which was called 66 times, avg 16.7ms/call: # once (397µs+27.4ms) by KiokuDB::TypeMap::BEGIN@4 at line 4 of KiokuDB/TypeMap.pm # once (546µs+24.7ms) by KiokuDB::Reference::BEGIN@4 at line 4 of KiokuDB/Reference.pm # once (244µs+24.7ms) by KiokuDB::BEGIN@4 at line 4 of KiokuDB.pm # once (253µs+23.5ms) by KiokuDB::Error::MissingObjects::BEGIN@2 at line 2 of KiokuDB/Error/MissingObjects.pm # once (236µs+22.1ms) by KiokuDB::Entry::Skip::BEGIN@4 at line 4 of KiokuDB/Entry/Skip.pm # once (229µs+21.9ms) by KiokuDB::Stream::Objects::BEGIN@4 at line 4 of KiokuDB/Stream/Objects.pm # once (262µs+21.6ms) by KiokuDB::LiveObjects::BEGIN@4 at line 4 of KiokuDB/LiveObjects.pm # once (230µs+21.6ms) by KiokuDB::TypeMap::Shadow::BEGIN@4 at line 4 of KiokuDB/TypeMap/Shadow.pm # once (241µs+21.5ms) by Data::Visitor::BEGIN@4 at line 4 of Data/Visitor.pm # once (229µs+21.4ms) by KiokuDB::TypeMap::Entry::Alias::BEGIN@4 at line 4 of KiokuDB/TypeMap/Entry/Alias.pm # once (229µs+21.3ms) by KiokuDB::LiveObjects::Scope::BEGIN@4 at line 4 of KiokuDB/LiveObjects/Scope.pm # once (228µs+21.3ms) by KiokuDB::Error::UnknownObjects::BEGIN@2 at line 2 of KiokuDB/Error/UnknownObjects.pm # once (240µs+21.3ms) by KiokuDB::Thunk::BEGIN@4 at line 4 of KiokuDB/Thunk.pm # once (254µs+21.2ms) by KiokuDB::Linker::BEGIN@4 at line 4 of KiokuDB/Linker.pm # once (247µs+21.2ms) by Devel::PartialDump::BEGIN@4 at line 4 of Devel/PartialDump.pm # once (230µs+21.2ms) by KiokuDB::TypeMap::Entry::Compiled::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Compiled.pm # once (229µs+21.2ms) by KiokuDB::TypeMap::Resolver::BEGIN@4 at line 4 of KiokuDB/TypeMap/Resolver.pm # once (230µs+21.1ms) by KiokuDB::LiveObjects::TXNScope::BEGIN@4 at line 4 of KiokuDB/LiveObjects/TXNScope.pm # once (231µs+21.1ms) by KiokuDB::Collapser::Buffer::BEGIN@2 at line 2 of KiokuDB/Collapser/Buffer.pm # once (246µs+21.0ms) by Data::Stream::Bulk::Cat::BEGIN@10 at line 10 of Data/Stream/Bulk/Cat.pm # once (229µs+21.0ms) by KiokuDB::TypeMap::Entry::MOP::BEGIN@4 at line 4 of KiokuDB/TypeMap/Entry/MOP.pm # once (228µs+21.0ms) by Data::Stream::Bulk::Filter::BEGIN@10 at line 10 of Data/Stream/Bulk/Filter.pm # once (228µs+20.9ms) by Data::Stream::Bulk::Nil::BEGIN@10 at line 10 of Data/Stream/Bulk/Nil.pm # once (226µs+20.7ms) by KiokuDB::Entry::BEGIN@4 at line 4 of KiokuDB/Entry.pm # once (227µs+20.6ms) by KiokuDB::Collapser::BEGIN@4 at line 4 of KiokuDB/Collapser.pm # once (234µs+18.6ms) by Moose::Meta::Method::Accessor::Native::Hash::values::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/values.pm # once (346µs+18.0ms) by Moose::Meta::Method::Accessor::Native::Writer::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Writer.pm # once (311µs+14.6ms) by KiokuDB::TypeMap::Entry::BEGIN@4 at line 4 of KiokuDB/TypeMap/Entry.pm # once (235µs+14.4ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait/Hash.pm # once (233µs+14.3ms) by MooseX::Clone::Meta::Attribute::Trait::Clone::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm # once (246µs+14.2ms) by KiokuDB::Backend::BEGIN@4 at line 4 of KiokuDB/Backend.pm # once (251µs+14.1ms) by KiokuDB::Error::BEGIN@2 at line 2 of KiokuDB/Error.pm # once (229µs+13.9ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait/Array.pm # once (332µs+13.7ms) by Data::Stream::Bulk::BEGIN@10 at line 10 of Data/Stream/Bulk.pm # once (227µs+13.7ms) by MooseX::Clone::Meta::Attribute::Trait::Clone::Base::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/Clone/Base.pm # once (301µs+13.6ms) by Moose::Meta::Method::Accessor::Native::Array::BEGIN@6 at line 6 of Moose/Meta/Method/Accessor/Native/Array.pm # once (236µs+13.7ms) by KiokuDB::TypeMap::Entry::Std::Compile::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Std/Compile.pm # once (231µs+13.7ms) by KiokuDB::TypeMap::Entry::Std::Intrinsic::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Std/Intrinsic.pm # once (271µs+13.6ms) by KiokuDB::TypeMap::Entry::Std::Expand::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Std/Expand.pm # once (226µs+13.6ms) by Moose::Meta::Method::Accessor::Native::Array::push::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/push.pm # once (234µs+13.6ms) by KiokuDB::Role::UUIDs::BEGIN@4 at line 4 of KiokuDB/Role/UUIDs.pm # once (237µs+13.5ms) by KiokuDB::TypeMap::Entry::Std::BEGIN@4 at line 4 of KiokuDB/TypeMap/Entry/Std.pm # once (223µs+13.6ms) by Moose::Meta::Method::Accessor::Native::Array::Writer::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/Writer.pm # once (224µs+13.5ms) by Moose::Meta::Method::Accessor::Native::Array::clear::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/clear.pm # once (236µs+13.5ms) by KiokuDB::Role::API::BEGIN@2 at line 2 of KiokuDB/Role/API.pm # once (228µs+13.5ms) by KiokuDB::TypeMap::Entry::Std::ID::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Std/ID.pm # once (231µs+13.5ms) by KiokuDB::Role::TypeMap::BEGIN@4 at line 4 of KiokuDB/Role/TypeMap.pm # once (226µs+13.5ms) by Moose::Meta::Method::Accessor::Native::Array::elements::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/elements.pm # once (225µs+13.4ms) by Moose::Meta::Method::Accessor::Native::Collection::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (230µs+13.4ms) by MooseX::Clone::Meta::Attribute::Trait::NoClone::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/NoClone.pm # once (224µs+13.4ms) by Moose::Meta::Method::Accessor::Native::Reader::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Reader.pm # once (227µs+13.4ms) by MooseX::Clone::Meta::Attribute::Trait::Copy::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/Copy.pm # once (227µs+13.4ms) by Throwable::BEGIN@5 at line 5 of Throwable.pm # once (230µs+13.4ms) by MooseX::Clone::Meta::Attribute::Trait::StrableClone::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/StorableClone.pm # once (227µs+13.4ms) by KiokuDB::Role::UUIDs::LibUUID::BEGIN@4 at line 4 of KiokuDB/Role/UUIDs/LibUUID.pm # once (237µs+13.4ms) by MooseX::Clone::Meta::Attribute::Trait::Clone::Std::BEGIN@2 at line 2 of MooseX/Clone/Meta/Attribute/Trait/Clone/Std.pm # once (241µs+13.3ms) by Moose::Meta::Method::Accessor::Native::Hash::keys::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/keys.pm # once (233µs+13.3ms) by MooseX::Clone::BEGIN@4 at line 4 of MooseX/Clone.pm # once (227µs+13.3ms) by Moose::Meta::Attribute::Native::Trait::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait.pm # once (224µs+13.0ms) by Moose::Meta::Method::Accessor::Native::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor/Native.pm # once (199µs+9.67ms) by KiokuDB::LiveObjects::BEGIN@16 at line 16 of KiokuDB/LiveObjects.pm # once (205µs+9.63ms) by KiokuDB::Entry::BEGIN@6 at line 6 of KiokuDB/Entry.pm # once (206µs+9.60ms) by Moose::Meta::Attribute::Native::Trait::BEGIN@6 at line 6 of Moose/Meta/Attribute/Native/Trait.pm # once (216µs+9.47ms) by KiokuDB::Backend::BEGIN@6 at line 6 of KiokuDB/Backend.pm # once (256µs+8.01ms) by Moose::BEGIN@35 at line 35 of Moose.pm # once (193µs+7.90ms) by Moose::Role::BEGIN@19 at line 19 of Moose/Role.pm
return sub {
379
380 # I think we could use Sub::Exporter's collector feature
381 # to do this, but that would be rather gross, since that
382 # feature isn't really designed to return a value to the
383 # caller of the exporter sub.
384 #
385 # Also, this makes sure we preserve backwards compat for
386 # _get_caller, so it always sees the arguments in the
387 # expected order.
38866145µs my $traits;
389661.13ms664.06ms ( $traits, @_ ) = _strip_traits(@_);
# spent 4.06ms making 66 calls to Moose::Exporter::_strip_traits, avg 62µs/call
390
39166141µs my $metaclass;
392661.01ms663.16ms ( $metaclass, @_ ) = _strip_metaclass(@_);
# spent 3.16ms making 66 calls to Moose::Exporter::_strip_metaclass, avg 48µs/call
39366164µs $metaclass
394 = Moose::Util::resolve_metaclass_alias( 'Class' => $metaclass )
395 if defined $metaclass && length $metaclass;
396
39766123µs my $meta_name;
398661.05ms662.85ms ( $meta_name, @_ ) = _strip_meta_name(@_);
# spent 2.85ms making 66 calls to Moose::Exporter::_strip_meta_name, avg 43µs/call
399
400 # Normally we could look at $_[0], but in some weird cases
401 # (involving goto &Moose::import), $_[0] ends as something
402 # else (like Squirrel).
40366232µs my $class = $exporting_package;
404
40566819µs661.04ms $CALLER = _get_caller(@_);
# spent 1.04ms making 66 calls to Moose::Exporter::_get_caller, avg 16µs/call
406
407 # this works because both pragmas set $^H (see perldoc
408 # perlvar) which affects the current compilation -
409 # i.e. the file who use'd us - which is why we don't need
410 # to do anything special to make it affect that file
411 # rather than this one (which is already compiled)
412
41366872µs661.01ms strict->import;
# spent 1.01ms making 66 calls to strict::import, avg 15µs/call
41466879µs664.29ms warnings->import;
# spent 4.29ms making 66 calls to warnings::import, avg 65µs/call
415
41666144µs my $did_init_meta;
4171322.83ms66844µs for my $c ( grep { $_->can('init_meta') } $class, @{$exports_from} ) {
# spent 844µs making 66 calls to UNIVERSAL::can, avg 13µs/call
418
419 # init_meta can apply a role, which when loaded uses
420 # Moose::Exporter, which in turn sets $CALLER, so we need
421 # to protect against that.
42260264µs local $CALLER = $CALLER;
42360754µs60497ms $c->init_meta(
# spent 339ms making 25 calls to Moose::init_meta, avg 13.5ms/call # spent 159ms making 35 calls to Moose::Role::init_meta, avg 4.53ms/call
424 for_class => $CALLER,
425 metaclass => $metaclass,
426 meta_name => $meta_name,
427 );
42860568µs $did_init_meta = 1;
429 }
430
43166258µs if ( $did_init_meta && @{$traits} ) {
432
433 # The traits will use Moose::Role, which in turn uses
434 # Moose::Exporter, which in turn sets $CALLER, so we need
435 # to protect against that.
436 local $CALLER = $CALLER;
437 _apply_meta_traits( $CALLER, $traits );
438 }
439 elsif ( @{$traits} ) {
440 require Moose;
441 Moose->throw_error(
442 "Cannot provide traits when $class does not have an init_meta() method"
443 );
444 }
445
44666310µs my ( undef, @args ) = @_;
44766224µs my $extra = shift @args if ref $args[0] eq 'HASH';
448
44966144µs $extra ||= {};
45066432µs if ( !$extra->{into} ) {
45166272µs $extra->{into_level} ||= 0;
45266212µs $extra->{into_level}++;
453 }
454
455662.31ms66572ms $class->$exporter( $extra, @args );
# spent 572ms making 66 calls to Sub::Exporter::__ANON__[Sub/Exporter.pm:756], avg 8.67ms/call
4563124µs };
457}
458
459
# spent 4.06ms (2.87+1.19) within Moose::Exporter::_strip_traits which was called 66 times, avg 62µs/call: # 66 times (2.87ms+1.19ms) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 389, avg 62µs/call
sub _strip_traits {
4601323.08ms661.19ms my $idx = first_index { ( $_ || '' ) eq '-traits' } @_;
# spent 1.19ms making 66 calls to List::MoreUtils::firstidx, avg 18µs/call
461
462661.23ms return ( [], @_ ) unless $idx >= 0 && $#_ >= $idx + 1;
463
464 my $traits = $_[ $idx + 1 ];
465
466 splice @_, $idx, 2;
467
468 $traits = [$traits] unless ref $traits;
469
470 return ( $traits, @_ );
471}
472
473
# spent 3.16ms (2.41+746µs) within Moose::Exporter::_strip_metaclass which was called 66 times, avg 48µs/call: # 66 times (2.41ms+746µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 392, avg 48µs/call
sub _strip_metaclass {
4741322.33ms66746µs my $idx = first_index { ( $_ || '' ) eq '-metaclass' } @_;
# spent 746µs making 66 calls to List::MoreUtils::firstidx, avg 11µs/call
475
476661.01ms return ( undef, @_ ) unless $idx >= 0 && $#_ >= $idx + 1;
477
478 my $metaclass = $_[ $idx + 1 ];
479
480 splice @_, $idx, 2;
481
482 return ( $metaclass, @_ );
483}
484
485
# spent 2.85ms (2.11+743µs) within Moose::Exporter::_strip_meta_name which was called 66 times, avg 43µs/call: # 66 times (2.11ms+743µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 398, avg 43µs/call
sub _strip_meta_name {
4861322.01ms66743µs my $idx = first_index { ( $_ || '' ) eq '-meta_name' } @_;
# spent 743µs making 66 calls to List::MoreUtils::firstidx, avg 11µs/call
487
488661.05ms return ( 'meta', @_ ) unless $idx >= 0 && $#_ >= $idx + 1;
489
490 my $meta_name = $_[ $idx + 1 ];
491
492 splice @_, $idx, 2;
493
494 return ( $meta_name, @_ );
495}
496
497sub _apply_meta_traits {
498 my ( $class, $traits ) = @_;
499
500 return unless @{$traits};
501
502 my $meta = Class::MOP::class_of($class);
503
504 my $type = ( split /::/, ref $meta )[-1]
505 or Moose->throw_error(
506 'Cannot determine metaclass type for trait application . Meta isa '
507 . ref $meta );
508
509 my @resolved_traits = map {
510 ref $_
511 ? $_
512 : Moose::Util::resolve_metatrait_alias( $type => $_ )
513 } @$traits;
514
515 return unless @resolved_traits;
516
517 my %args = ( for => $class );
518
519 if ( $meta->isa('Moose::Meta::Role') ) {
520 $args{role_metaroles} = { role => \@resolved_traits };
521 }
522 else {
523 $args{class_metaroles} = { class => \@resolved_traits };
524 }
525
526 Moose::Util::MetaRole::apply_metaroles(%args);
527}
528
529
# spent 1.04ms within Moose::Exporter::_get_caller which was called 66 times, avg 16µs/call: # 66 times (1.04ms+0s) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 405, avg 16µs/call
sub _get_caller {
530
531 # 1 extra level because it's called by import so there's a layer
532 # of indirection
53366151µs my $offset = 1;
534
535 return
536661.38ms ( ref $_[1] && defined $_[1]->{into} ) ? $_[1]->{into}
537 : ( ref $_[1] && defined $_[1]->{into_level} )
538 ? caller( $offset + $_[1]->{into_level} )
539 : caller($offset);
540}
541
542
# spent 88µs within Moose::Exporter::_make_unimport_sub which was called 3 times, avg 29µs/call: # 3 times (88µs+0s) by Moose::Exporter::build_import_methods at line 63, avg 29µs/call
sub _make_unimport_sub {
54337µs shift;
54439µs my $exporting_package = shift;
54537µs my $exports = shift;
54636µs my $export_recorder = shift;
54736µs my $is_reexport = shift;
548
549
# spent 11.0ms (771µs+10.2) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:557] which was called 15 times, avg 733µs/call: # once (98µs+1.01ms) by Moose::Meta::Method::Accessor::Native::Hash::values::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash/values.pm # once (62µs+835µs) by Moose::Meta::Method::Accessor::Native::Writer::BEGIN@177 at line 177 of Moose/Meta/Method/Accessor/Native/Writer.pm # once (46µs+711µs) by Moose::Meta::Method::Accessor::Native::Array::elements::BEGIN@24 at line 24 of Moose/Meta/Method/Accessor/Native/Array/elements.pm # once (43µs+707µs) by Moose::Meta::Method::Accessor::Native::Array::clear::BEGIN@37 at line 37 of Moose/Meta/Method/Accessor/Native/Array/clear.pm # once (44µs+700µs) by Moose::Meta::Method::Accessor::Native::Hash::keys::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash/keys.pm # once (53µs+672µs) by Moose::Meta::Method::Accessor::Native::Array::BEGIN@28 at line 28 of Moose/Meta/Method/Accessor/Native/Array.pm # once (43µs+681µs) by Moose::Meta::Method::Accessor::Native::Array::push::BEGIN@44 at line 44 of Moose/Meta/Method/Accessor/Native/Array/push.pm # once (50µs+656µs) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@13 at line 13 of Moose/Meta/Attribute/Native/Trait/Hash.pm # once (45µs+657µs) by Moose::Meta::Method::Accessor::Native::Collection::BEGIN@149 at line 149 of Moose/Meta/Method/Accessor/Native/Collection.pm # once (43µs+649µs) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@13 at line 13 of Moose/Meta/Attribute/Native/Trait/Array.pm # once (43µs+641µs) by Moose::Meta::Method::Accessor::Native::Reader::BEGIN@48 at line 48 of Moose/Meta/Method/Accessor/Native/Reader.pm # once (53µs+615µs) by Moose::Meta::Attribute::Native::Trait::BEGIN@198 at line 198 of Moose/Meta/Attribute/Native/Trait.pm # once (44µs+604µs) by Moose::Meta::Method::Accessor::Native::BEGIN@153 at line 153 of Moose/Meta/Method/Accessor/Native.pm # once (43µs+581µs) by Moose::Meta::Attribute::Native::Trait::BEGIN@199 at line 199 of Moose/Meta/Attribute/Native/Trait.pm # once (59µs+502µs) by Throwable::BEGIN@31 at line 31 of Throwable.pm
return sub {
5501589µs my $caller = scalar caller();
551 Moose::Exporter->_remove_keywords(
552 $caller,
55315669µs1510.2ms [ keys %{$exports} ],
# spent 10.2ms making 15 calls to Moose::Exporter::_remove_keywords, avg 681µs/call
554 $export_recorder,
555 $is_reexport,
556 );
557363µs };
558}
559
560
# spent 10.2ms (10.0+189µs) within Moose::Exporter::_remove_keywords which was called 15 times, avg 681µs/call: # 15 times (10.0ms+189µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:557] at line 553, avg 681µs/call
sub _remove_keywords {
5611545µs shift;
5621551µs my $package = shift;
5631541µs my $keywords = shift;
5641540µs my $recorded_exports = shift;
5651540µs my $is_reexport = shift;
566
5673243µs2200µs
# spent 123µs (47+77) within Moose::Exporter::BEGIN@567 which was called: # once (47µs+77µs) by Moose::BEGIN@15 at line 567
no strict 'refs';
# spent 123µs making 1 call to Moose::Exporter::BEGIN@567 # spent 77µs making 1 call to strict::unimport
568
56915331µs foreach my $name ( @{$keywords} ) {
5702132.68ms if ( defined &{ $package . '::' . $name } ) {
5712131.77ms my $sub = \&{ $package . '::' . $name };
572
573 # make sure it is from us
574213882µs next unless $recorded_exports->{$sub};
575
576213556µs if ( $is_reexport->{$name} ) {
57731.13ms2145µs
# spent 90µs (36+55) within Moose::Exporter::BEGIN@577 which was called: # once (36µs+55µs) by Moose::BEGIN@15 at line 577
no strict 'refs';
# spent 90µs making 1 call to Moose::Exporter::BEGIN@577 # spent 54µs making 1 call to strict::unimport
578 next
579 unless _export_is_flagged(
58028865µs28188µs \*{ join q{::} => $package, $name } );
# spent 188µs making 28 calls to Moose::Exporter::_export_is_flagged, avg 7µs/call
581 }
582
583 # and if it is from us, then undef the slot
5842113.04ms delete ${ $package . '::' }{$name};
585 }
586 }
587}
588
589
# spent 277µs within Moose::Exporter::_make_init_meta which was called 3 times, avg 92µs/call: # 3 times (277µs+0s) by Moose::Exporter::build_import_methods at line 70, avg 92µs/call
sub _make_init_meta {
59037µs shift;
59139µs my $class = shift;
59237µs my $args = shift;
593
59436µs my %old_style_roles;
595381µs for my $role (
596 map {"${_}_roles"}
597 qw(
598 metaclass
599 attribute_metaclass
600 method_metaclass
601 wrapped_method_metaclass
602 instance_metaclass
603 constructor_class
604 destructor_class
605 error_class
606 )
607 ) {
60824102µs $old_style_roles{$role} = $args->{$role}
609 if exists $args->{$role};
610 }
611
61236µs my %base_class_roles;
61338µs %base_class_roles = ( roles => $args->{base_class_roles} )
614 if exists $args->{base_class_roles};
615
616 my %new_style_roles = map { $_ => $args->{$_} }
617318µs grep { exists $args->{$_} } qw( class_metaroles role_metaroles );
618
619346µs return unless %new_style_roles || %old_style_roles || %base_class_roles;
620
621 return sub {
622 shift;
623 my %options = @_;
624
625 return unless Class::MOP::class_of( $options{for_class} );
626
627 if ( %new_style_roles || %old_style_roles ) {
628 Moose::Util::MetaRole::apply_metaroles(
629 for => $options{for_class},
630 %new_style_roles,
631 %old_style_roles,
632 );
633 }
634
635 Moose::Util::MetaRole::apply_base_class_roles(
636 for_class => $options{for_class},
637 %base_class_roles,
638 )
639 if Class::MOP::class_of( $options{for_class} )
640 ->isa('Moose::Meta::Class');
641
642 return Class::MOP::class_of( $options{for_class} );
643 };
644}
645
646
# spent 453µs (154+299) within Moose::Exporter::import which was called 3 times, avg 151µs/call: # once (61µs+113µs) by Moose::Util::TypeConstraints::BEGIN@7 at line 7 of Moose/Util/TypeConstraints.pm # once (49µs+91µs) by Moose::BEGIN@15 at line 15 of Moose.pm # once (45µs+94µs) by Moose::Role::BEGIN@17 at line 17 of Moose/Role.pm
sub import {
647343µs353µs strict->import;
# spent 53µs making 3 calls to strict::import, avg 18µs/call
648388µs3246µs warnings->import;
# spent 246µs making 3 calls to warnings::import, avg 82µs/call
649}
650
651128µs1;
652
653__END__
 
# spent 188µs within Moose::Exporter::_export_is_flagged which was called 28 times, avg 7µs/call: # 28 times (188µs+0s) by Moose::Exporter::_remove_keywords at line 580, avg 7µs/call
sub Moose::Exporter::_export_is_flagged; # xsub
# spent 846µs within Moose::Exporter::_flag_as_reexport which was called 118 times, avg 7µs/call: # 118 times (846µs+0s) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:125] at line 123, avg 7µs/call
sub Moose::Exporter::_flag_as_reexport; # xsub