← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:06 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Exporter.pm
StatementsExecuted 1024 statements in 3.39ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.40ms64.2msMoose::Exporter::::BEGIN@8Moose::Exporter::BEGIN@8
111647µs5.25msMoose::Exporter::::BEGIN@9Moose::Exporter::BEGIN@9
111490µs4.63msMoose::Exporter::::BEGIN@10Moose::Exporter::BEGIN@10
211162µs238µsMoose::Exporter::::_make_sub_exporter_paramsMoose::Exporter::_make_sub_exporter_params
21198µs1.18msMoose::Exporter::::build_import_methodsMoose::Exporter::build_import_methods
85271µs26.4msMoose::::has Moose::has
21156µs315µsMoose::Exporter::::__ANON__[:140]Moose::Exporter::__ANON__[:140]
303151µs51µsMoose::Exporter::::_sub_from_packageMoose::Exporter::_sub_from_package
11145µs46µsMoose::Exporter::::_remove_keywordsMoose::Exporter::_remove_keywords
81139µs79µsMoose::Exporter::::__ANON__[:389]Moose::Exporter::__ANON__[:389]
21132µs32µsMoose::Exporter::::_collect_metarolesMoose::Exporter::_collect_metaroles
41123µs39µsMoose::Exporter::::__ANON__[:252]Moose::Exporter::__ANON__[:252]
21122µs22µsMoose::Exporter::::_make_init_metaMoose::Exporter::_make_init_meta
81122µs22µsMoose::Exporter::::_late_curry_wrapperMoose::Exporter::_late_curry_wrapper
221121µs21µsMoose::Exporter::::__ANON__[:317]Moose::Exporter::__ANON__[:317]
21119µs59µsMoose::Exporter::::_follow_alsoMoose::Exporter::_follow_also
21118µs64µsMoose::Exporter::::_apply_metarolesMoose::Exporter::_apply_metaroles
21118µs595µsMoose::Exporter::::_make_exporterMoose::Exporter::_make_exporter
22217µs1.20msMoose::Exporter::::setup_import_methodsMoose::Exporter::setup_import_methods
21117µs29µsMoose::Exporter::::_strip_traitsMoose::Exporter::_strip_traits
21117µs27µsMoose::Exporter::::_die_if_cycle_found_in_also_list_for_packageMoose::Exporter::_die_if_cycle_found_in_also_list_for_package
22213µs27µsMoose::Exporter::::importMoose::Exporter::import
11112µs36µsMoose::Exporter::::BEGIN@11Moose::Exporter::BEGIN@11
81112µs12µsMoose::Exporter::::_make_wrapped_sub_with_metaMoose::Exporter::_make_wrapped_sub_with_meta
42110µs21µsMoose::Exporter::::__ANON__[:39]Moose::Exporter::__ANON__[:39]
1119µs11µsMoose::Exporter::::BEGIN@4Moose::Exporter::BEGIN@4
2119µs9µsMoose::Exporter::::_make_import_subMoose::Exporter::_make_import_sub
2119µs9µsMoose::Exporter::::_make_unimport_subMoose::Exporter::_make_unimport_sub
2119µs11µsMoose::Exporter::::_strip_meta_nameMoose::Exporter::_strip_meta_name
1119µs73µsMoose::Exporter::::BEGIN@12Moose::Exporter::BEGIN@12
2119µs11µsMoose::Exporter::::_strip_metaclassMoose::Exporter::_strip_metaclass
1117µs19µsMoose::Exporter::::BEGIN@135Moose::Exporter::BEGIN@135
2117µs7µsMoose::Exporter::::_parse_trait_aliasesMoose::Exporter::_parse_trait_aliases
1117µs15µsMoose::Exporter::::BEGIN@331Moose::Exporter::BEGIN@331
22117µs7µsMoose::Exporter::::CORE:matchMoose::Exporter::CORE:match (opcode)
1116µs30µsMoose::Exporter::::BEGIN@7Moose::Exporter::BEGIN@7
2116µs8µsMoose::Exporter::::_follow_also_realMoose::Exporter::_follow_also_real
4216µs6µsMoose::Exporter::::_also_list_for_packageMoose::Exporter::_also_list_for_package
2116µs6µsMoose::Exporter::::_get_callerMoose::Exporter::_get_caller
1116µs21µsMoose::Exporter::::BEGIN@13Moose::Exporter::BEGIN@13
1116µs15µsMoose::Exporter::::BEGIN@725Moose::Exporter::BEGIN@725
1115µs18µsMoose::Exporter::::BEGIN@136Moose::Exporter::BEGIN@136
1115µs12µsMoose::Exporter::::BEGIN@5Moose::Exporter::BEGIN@5
2115µs5µsMoose::Exporter::::_die_if_also_list_cycles_back_to_existing_stackMoose::Exporter::_die_if_also_list_cycles_back_to_existing_stack
1114µs10µsMoose::Exporter::::BEGIN@735Moose::Exporter::BEGIN@735
1114µs76µsMoose::Exporter::::BEGIN@15Moose::Exporter::BEGIN@15
2112µs2µsMoose::Exporter::::_flag_as_reexportMoose::Exporter::_flag_as_reexport (xsub)
211900ns900nsMoose::Exporter::::_export_is_flaggedMoose::Exporter::_export_is_flagged (xsub)
0000s0sMoose::Exporter::::__ANON__[:228]Moose::Exporter::__ANON__[:228]
0000s0sMoose::Exporter::::__ANON__[:366]Moose::Exporter::__ANON__[:366]
0000s0sMoose::Exporter::::__ANON__[:398]Moose::Exporter::__ANON__[:398]
0000s0sMoose::Exporter::::__ANON__[:420]Moose::Exporter::__ANON__[:420]
0000s0sMoose::Exporter::::__ANON__[:528]Moose::Exporter::__ANON__[:528]
0000s0sMoose::Exporter::::__ANON__[:532]Moose::Exporter::__ANON__[:532]
0000s0sMoose::Exporter::::__ANON__[:546]Moose::Exporter::__ANON__[:546]
0000s0sMoose::Exporter::::__ANON__[:558]Moose::Exporter::__ANON__[:558]
0000s0sMoose::Exporter::::__ANON__[:715]Moose::Exporter::__ANON__[:715]
0000s0sMoose::Exporter::::__ANON__[:787]Moose::Exporter::__ANON__[:787]
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
0000s0sMoose::::after Moose::after
0000s0sMoose::::around Moose::around
0000s0sMoose::::augment Moose::augment
0000s0sMoose::::before Moose::before
0000s0sMoose::::extends Moose::extends
0000s0sMoose::::override Moose::override
0000s0sMoose::::with Moose::with
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;
21500nsour $VERSION = '2.1605';
3
4215µs213µs
# spent 11µs (9+2) within Moose::Exporter::BEGIN@4 which was called: # once (9µs+2µs) by Moose::BEGIN@15 at line 4
use strict;
# spent 11µs making 1 call to Moose::Exporter::BEGIN@4 # spent 2µs making 1 call to strict::import
5216µs219µs
# spent 12µs (5+7) within Moose::Exporter::BEGIN@5 which was called: # once (5µs+7µs) by Moose::BEGIN@15 at line 5
use warnings;
# spent 12µs making 1 call to Moose::Exporter::BEGIN@5 # spent 7µs making 1 call to warnings::import
6
7215µs254µs
# spent 30µs (6+24) within Moose::Exporter::BEGIN@7 which was called: # once (6µs+24µs) by Moose::BEGIN@15 at line 7
use Class::Load qw(is_class_loaded);
# spent 30µs making 1 call to Moose::Exporter::BEGIN@7 # spent 24µs making 1 call to Exporter::import
82138µs164.2ms
# spent 64.2ms (2.40+61.8) within Moose::Exporter::BEGIN@8 which was called: # once (2.40ms+61.8ms) by Moose::BEGIN@15 at line 8
use Class::MOP;
# spent 64.2ms making 1 call to Moose::Exporter::BEGIN@8
92101µs25.57ms
# spent 5.25ms (647µs+4.60) within Moose::Exporter::BEGIN@9 which was called: # once (647µs+4.60ms) by Moose::BEGIN@15 at line 9
use List::MoreUtils qw( first_index uniq );
# spent 5.25ms making 1 call to Moose::Exporter::BEGIN@9 # spent 324µs making 1 call to Exporter::Tiny::import
102122µs14.63ms
# spent 4.63ms (490µs+4.14) within Moose::Exporter::BEGIN@10 which was called: # once (490µs+4.14ms) by Moose::BEGIN@15 at line 10
use Moose::Util::MetaRole;
# spent 4.63ms making 1 call to Moose::Exporter::BEGIN@10
11332µs360µs
# spent 36µs (12+24) within Moose::Exporter::BEGIN@11 which was called: # once (12µs+24µs) by Moose::BEGIN@15 at line 11
use Scalar::Util 1.11 qw(reftype);
# spent 36µs making 1 call to Moose::Exporter::BEGIN@11 # spent 18µs making 1 call to Exporter::import # spent 6µs making 1 call to UNIVERSAL::VERSION
12328µs3136µs
# spent 73µs (9+64) within Moose::Exporter::BEGIN@12 which was called: # once (9µs+64µs) by Moose::BEGIN@15 at line 12
use Sub::Exporter 0.980;
# spent 73µs making 1 call to Moose::Exporter::BEGIN@12 # spent 59µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337] # spent 4µs making 1 call to UNIVERSAL::VERSION
13218µs237µs
# spent 21µs (6+15) within Moose::Exporter::BEGIN@13 which was called: # once (6µs+15µs) by Moose::BEGIN@15 at line 13
use Sub::Name qw(subname);
# spent 21µs making 1 call to Moose::Exporter::BEGIN@13 # spent 15µs making 1 call to Exporter::import
14
152280µs2148µs
# spent 76µs (4+72) within Moose::Exporter::BEGIN@15 which was called: # once (4µs+72µs) by Moose::BEGIN@15 at line 15
use Moose::Util 'throw_exception';
# spent 76µs making 1 call to Moose::Exporter::BEGIN@15 # spent 72µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
16
171200nsmy %EXPORT_SPEC;
18
19
# spent 1.20ms (17µs+1.18) within Moose::Exporter::setup_import_methods which was called 2 times, avg 599µs/call: # once (9µs+613µs) by Moose::Meta::Attribute::BEGIN@16 at line 38 of Moose/Util/TypeConstraints.pm # once (8µs+569µs) by DBIx::MultiStatementDo::BEGIN@8 at line 132 of Moose.pm
sub setup_import_methods {
2023µs my ( $class, %args ) = @_;
21
2223µs $args{exporting_package} ||= caller();
23
24211µs21.18ms $class->build_import_methods(
# spent 1.18ms making 2 calls to Moose::Exporter::build_import_methods, avg 591µs/call
25 %args,
26 install => [qw(import unimport init_meta)]
27 );
28}
29
30# A reminder to intrepid Moose hackers
31# there may be more than one level of exporter
32# don't make doy cry. -- perigrin
33
34
# spent 1.18ms (98µs+1.08) within Moose::Exporter::build_import_methods which was called 2 times, avg 591µs/call: # 2 times (98µs+1.08ms) by Moose::Exporter::setup_import_methods at line 24, avg 591µs/call
sub build_import_methods {
3522µs my ( $class, %args ) = @_;
36
3721µs my $exporting_package = $args{exporting_package} ||= caller();
38
39615µs411µs
# spent 21µs (10+11) within Moose::Exporter::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Exporter.pm:39] which was called 4 times, avg 5µs/call: # 2 times (6µs+6µs) by Moose::Exporter::_apply_metaroles at line 575, avg 6µs/call # 2 times (4µs+5µs) by Moose::Exporter::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Exporter.pm:140] at line 111, avg 4µs/call
my $meta_lookup = $args{meta_lookup} || sub { Class::MOP::class_of(shift) };
# spent 11µs making 4 calls to Class::MOP::class_of, avg 3µs/call
40
4122µs $EXPORT_SPEC{$exporting_package} = \%args;
42
4324µs259µs my @exports_from = $class->_follow_also($exporting_package);
# spent 59µs making 2 calls to Moose::Exporter::_follow_also, avg 29µs/call
44
4521µs my $export_recorder = {};
462800ns my $is_reexport = {};
47
48 my $exports = $class->_make_sub_exporter_params(
49 [ $exporting_package, @exports_from ],
50 $export_recorder,
51 $is_reexport,
52 $args{meta_lookup}, # so that we don't pass through the default
5327µs2238µs );
# spent 238µs making 2 calls to Moose::Exporter::_make_sub_exporter_params, avg 119µs/call
54
5524µs2595µs my $exporter = $class->_make_exporter(
# spent 595µs making 2 calls to Moose::Exporter::_make_exporter, avg 297µs/call
56 $exports,
57 $is_reexport,
58 $meta_lookup,
59 );
60
612400ns my %methods;
6226µs29µs $methods{import} = $class->_make_import_sub(
# spent 9µs making 2 calls to Moose::Exporter::_make_import_sub, avg 5µs/call
63 $exporting_package,
64 $exporter,
65 \@exports_from,
66 $is_reexport,
67 $meta_lookup,
68 );
69
7025µs29µs $methods{unimport} = $class->_make_unimport_sub(
# spent 9µs making 2 calls to Moose::Exporter::_make_unimport_sub, avg 5µs/call
71 $exporting_package,
72 $exports,
73 $export_recorder,
74 $is_reexport,
75 $meta_lookup,
76 );
77
7827µs222µs $methods{init_meta} = $class->_make_init_meta(
# spent 22µs making 2 calls to Moose::Exporter::_make_init_meta, avg 11µs/call
79 $exporting_package,
80 \%args,
81 $meta_lookup,
82 );
83
8425µs242µs my $package = Class::MOP::Package->initialize($exporting_package);
# spent 42µs making 2 calls to Class::MOP::Package::initialize, avg 21µs/call
8522µs for my $to_install ( @{ $args{install} || [] } ) {
8664µs my $symbol = '&' . $to_install;
87
88 next
8968µs457µs unless $methods{$to_install}
# spent 57µs making 4 calls to Class::MOP::Package::has_package_symbol, avg 14µs/call
90 && !$package->has_package_symbol($symbol);
91 $package->add_package_symbol(
92 $symbol,
93 subname(
94428µs852µs $exporting_package . '::' . $to_install, $methods{$to_install}
# spent 37µs making 4 calls to Class::MOP::Package::add_package_symbol, avg 9µs/call # spent 15µs making 4 calls to Sub::Name::subname, avg 4µs/call
95 )
96 );
97 }
98
9926µs return ( $methods{import}, $methods{unimport}, $methods{init_meta} );
100}
101
102
# spent 595µs (18+577) within Moose::Exporter::_make_exporter which was called 2 times, avg 297µs/call: # 2 times (18µs+577µs) by Moose::Exporter::build_import_methods at line 55, avg 297µs/call
sub _make_exporter {
10321µs my ($class, $exports, $is_reexport, $meta_lookup) = @_;
104
105 return Sub::Exporter::build_exporter(
106 {
107 exports => $exports,
108 groups => { default => [':all'] },
109
# spent 315µs (56+259) within Moose::Exporter::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Exporter.pm:140] which was called 2 times, avg 157µs/call: # 2 times (56µs+259µs) by Sub::Exporter::_do_import at line 386 of Sub/Exporter.pm, avg 157µs/call
installer => sub {
1102700ns my ($arg, $to_export) = @_;
11122µs28µs my $meta = $meta_lookup->($arg->{into});
# spent 8µs making 2 calls to Moose::Exporter::__ANON__[Moose/Exporter.pm:39], avg 4µs/call
112
11324µs1289µs goto &Sub::Exporter::default_installer unless $meta;
# spent 289µs making 1 call to Sub::Exporter::default_installer
114
115 # don't overwrite existing symbols with our magically flagged
116 # version of it if we would install the same sub that's already
117 # in the importer
118
1191300ns my @filtered_to_export;
120 my %installed;
12114µs for (my $i = 0; $i < @{ $to_export }; $i += 2) {
122125µs my ($as, $cv) = @{ $to_export }[$i, $i + 1];
123
1241211µs1247µs next if !ref($as)
# spent 47µs making 12 calls to Class::MOP::Package::has_package_symbol, avg 4µs/call
125 && $meta->has_package_symbol('&' . $as)
126 && $meta->get_package_symbol('&' . $as) == $cv;
127
128123µs push @filtered_to_export, $as, $cv;
129124µs $installed{$as} = 1 unless ref $as;
130 }
131
13211µs1201µs Sub::Exporter::default_installer($arg, \@filtered_to_export);
# spent 201µs making 1 call to Sub::Exporter::default_installer
133
13416µs for my $name ( keys %{$is_reexport} ) {
135218µs230µs
# spent 19µs (7+11) within Moose::Exporter::BEGIN@135 which was called: # once (7µs+11µs) by Moose::BEGIN@15 at line 135
no strict 'refs';
# spent 19µs making 1 call to Moose::Exporter::BEGIN@135 # spent 12µs making 1 call to strict::unimport
1362545µs231µs
# spent 18µs (5+13) within Moose::Exporter::BEGIN@136 which was called: # once (5µs+13µs) by Moose::BEGIN@15 at line 136
no warnings 'once';
# spent 18µs making 1 call to Moose::Exporter::BEGIN@136 # spent 13µs making 1 call to warnings::unimport
1372400ns next unless exists $installed{$name};
13829µs22µs _flag_as_reexport( \*{ join q{::}, $arg->{into}, $name } );
# spent 2µs making 2 calls to Moose::Exporter::_flag_as_reexport, avg 1µs/call
139 }
140 },
141 }
142218µs2577µs );
# spent 577µs making 2 calls to Sub::Exporter::build_exporter, avg 288µs/call
143}
144
145
# spent 59µs (19+39) within Moose::Exporter::_follow_also which was called 2 times, avg 29µs/call: # 2 times (19µs+39µs) by Moose::Exporter::build_import_methods at line 43, avg 29µs/call
sub _follow_also {
1462900ns my $class = shift;
1472500ns my $exporting_package = shift;
148
14923µs227µs _die_if_cycle_found_in_also_list_for_package($exporting_package);
# spent 27µs making 2 calls to Moose::Exporter::_die_if_cycle_found_in_also_list_for_package, avg 13µs/call
150
151218µs413µs return uniq( _follow_also_real($exporting_package) );
# spent 8µs making 2 calls to Moose::Exporter::_follow_also_real, avg 4µs/call # spent 5µs making 2 calls to List::MoreUtils::uniq, avg 3µs/call
152}
153
154
# spent 8µs (6+1) within Moose::Exporter::_follow_also_real which was called 2 times, avg 4µs/call: # 2 times (6µs+1µs) by Moose::Exporter::_follow_also at line 151, avg 4µs/call
sub _follow_also_real {
1552600ns my $exporting_package = shift;
15622µs21µs my @also = _also_list_for_package($exporting_package);
# spent 1µs making 2 calls to Moose::Exporter::_also_list_for_package, avg 550ns/call
157
15823µs return map { $_, _follow_also_real($_) } @also;
159}
160
161
# spent 6µs within Moose::Exporter::_also_list_for_package which was called 4 times, avg 2µs/call: # 2 times (5µs+0s) by Moose::Exporter::_die_if_cycle_found_in_also_list_for_package at line 183, avg 3µs/call # 2 times (1µs+0s) by Moose::Exporter::_follow_also_real at line 156, avg 550ns/call
sub _also_list_for_package {
1624700ns my $package = shift;
163
16441µs if ( !exists $EXPORT_SPEC{$package} ) {
165 my $loaded = is_class_loaded($package);
166
167 throw_exception( PackageDoesNotUseMooseExporter => package => $package,
168 is_loaded => $loaded
169 );
170 }
171
17241µs my $also = $EXPORT_SPEC{$package}{also};
173
174411µs return unless defined $also;
175
176 return ref $also ? @$also : $also;
177}
178
179# this is no Tarjan algorithm, but for the list sizes expected,
180# brute force will probably be fine (and more maintainable)
181
# spent 27µs (17+10) within Moose::Exporter::_die_if_cycle_found_in_also_list_for_package which was called 2 times, avg 13µs/call: # 2 times (17µs+10µs) by Moose::Exporter::_follow_also at line 149, avg 13µs/call
sub _die_if_cycle_found_in_also_list_for_package {
18222µs my $package = shift;
183212µs410µs _die_if_also_list_cycles_back_to_existing_stack(
# spent 5µs making 2 calls to Moose::Exporter::_also_list_for_package, avg 3µs/call # spent 5µs making 2 calls to Moose::Exporter::_die_if_also_list_cycles_back_to_existing_stack, avg 2µs/call
184 [ _also_list_for_package($package) ],
185 [$package],
186 );
187}
188
189
# spent 5µs within Moose::Exporter::_die_if_also_list_cycles_back_to_existing_stack which was called 2 times, avg 2µs/call: # 2 times (5µs+0s) by Moose::Exporter::_die_if_cycle_found_in_also_list_for_package at line 183, avg 2µs/call
sub _die_if_also_list_cycles_back_to_existing_stack {
1902900ns my ( $also_list, $existing_stack ) = @_;
191
19224µs return unless @$also_list && @$existing_stack;
193
194 for my $also_member (@$also_list) {
195 for my $stack_member (@$existing_stack) {
196 next unless $also_member eq $stack_member;
197
198 throw_exception( CircularReferenceInAlso => also_parameter => $also_member,
199 stack => $existing_stack
200 );
201 }
202
203 _die_if_also_list_cycles_back_to_existing_stack(
204 [ _also_list_for_package($also_member) ],
205 [ $also_member, @$existing_stack ],
206 );
207 }
208}
209
210
# spent 7µs within Moose::Exporter::_parse_trait_aliases which was called 2 times, avg 4µs/call: # 2 times (7µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 283, avg 4µs/call
sub _parse_trait_aliases {
2112600ns my $class = shift;
21221µs my ($package, $aliases) = @_;
213
2142400ns my @ret;
21523µs for my $alias (@$aliases) {
216 my $name;
217 if (ref($alias)) {
218 reftype($alias) eq 'ARRAY'
219 or throw_exception( InvalidArgumentsToTraitAliases => class_name => $class,
220 package_name => $package,
221 alias => $alias
222 );
223 ($alias, $name) = @$alias;
224 }
225 else {
226 ($name = $alias) =~ s/.*:://;
227 }
228 push @ret, subname "${package}::${name}" => sub () { $alias };
229 }
230
23126µs return @ret;
232}
233
234
# spent 238µs (162+76) within Moose::Exporter::_make_sub_exporter_params which was called 2 times, avg 119µs/call: # 2 times (162µs+76µs) by Moose::Exporter::build_import_methods at line 53, avg 119µs/call
sub _make_sub_exporter_params {
2352500ns my $class = shift;
2362500ns my $packages = shift;
2372500ns my $export_recorder = shift;
2382400ns my $is_reexport = shift;
23922µs my $meta_lookup_override = shift;
240
2412600ns my %exports;
242 my $current_meta_lookup;
243
24422µs for my $package ( @{$packages} ) {
24522µs my $args = $EXPORT_SPEC{$package}
246 or die "The $package package does not use Moose::Exporter\n";
247
24821µs $current_meta_lookup = $meta_lookup_override || $args->{meta_lookup};
2492400ns $meta_lookup_override = $current_meta_lookup;
250
251 my $meta_lookup = $current_meta_lookup
252614µs416µs
# spent 39µs (23+16) within Moose::Exporter::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Exporter.pm:252] which was called 4 times, avg 10µs/call: # 4 times (23µs+16µs) by Moose::has at line 418, avg 10µs/call
|| sub { Class::MOP::class_of(shift) };
# spent 16µs making 4 calls to Class::MOP::class_of, avg 4µs/call
253
25424µs for my $name ( @{ $args->{with_meta} } ) {
25585µs812µs my $sub = $class->_sub_from_package( $package, $name )
# spent 12µs making 8 calls to Moose::Exporter::_sub_from_package, avg 2µs/call
256 or next;
257
25882µs my $fq_name = $package . '::' . $name;
259
260 $exports{$name} = $class->_make_wrapped_sub_with_meta(
261 $fq_name,
262 $sub,
263 $export_recorder,
264 $meta_lookup,
265813µs812µs ) unless exists $exports{$name};
# spent 12µs making 8 calls to Moose::Exporter::_make_wrapped_sub_with_meta, avg 1µs/call
266 }
267
26823µs for my $name ( @{ $args->{with_caller} } ) {
269 my $sub = $class->_sub_from_package( $package, $name )
270 or next;
271
272 my $fq_name = $package . '::' . $name;
273
274 $exports{$name} = $class->_make_wrapped_sub(
275 $fq_name,
276 $sub,
277 $export_recorder,
278 ) unless exists $exports{$name};
279 }
280
281 my @extra_exports = $class->_parse_trait_aliases(
282 $package, $args->{trait_aliases},
28325µs27µs );
# spent 7µs making 2 calls to Moose::Exporter::_parse_trait_aliases, avg 4µs/call
28423µs for my $name ( @{ $args->{as_is} }, @extra_exports ) {
285222µs my ( $sub, $coderef_name );
286
2872232µs227µs if ( ref $name ) {
# spent 7µs making 22 calls to Moose::Exporter::CORE:match, avg 314ns/call
288 $sub = $name;
289
290 my $coderef_pkg;
291 ( $coderef_pkg, $coderef_name )
292 = Class::MOP::get_code_info($name);
293
294 if ( $coderef_pkg ne $package ) {
295 $is_reexport->{$coderef_name} = 1;
296 }
297 }
298 elsif ( $name =~ /^(.*)::([^:]+)$/ ) {
29924µs23µs $sub = $class->_sub_from_package( "$1", "$2" )
# spent 3µs making 2 calls to Moose::Exporter::_sub_from_package, avg 2µs/call
300 or next;
301
3022600ns $coderef_name = "$2";
303
30422µs if ( $1 ne $package ) {
305 $is_reexport->{$coderef_name} = 1;
306 }
307 }
308 else {
3092013µs2035µs $sub = $class->_sub_from_package( $package, $name )
# spent 35µs making 20 calls to Moose::Exporter::_sub_from_package, avg 2µs/call
310 or next;
311
312203µs $coderef_name = $name;
313 }
314
3152212µs $export_recorder->{$sub} = 1;
316
3172225µs
# spent 21µs within Moose::Exporter::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Exporter.pm:317] which was called 22 times, avg 955ns/call: # 22 times (21µs+0s) by Sub::Exporter::default_generator at line 420 of Sub/Exporter.pm, avg 955ns/call
$exports{$coderef_name} = sub { $sub }
3182224µs unless exists $exports{$coderef_name};
319 }
320 }
321
32225µs return \%exports;
323}
324
325
# spent 51µs within Moose::Exporter::_sub_from_package which was called 30 times, avg 2µs/call: # 20 times (35µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 309, avg 2µs/call # 8 times (12µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 255, avg 2µs/call # 2 times (3µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 299, avg 2µs/call
sub _sub_from_package {
326303µs my $sclass = shift;
327304µs my $package = shift;
328303µs my $name = shift;
329
330306µs my $sub = do {
3312913µs223µs
# spent 15µs (7+8) within Moose::Exporter::BEGIN@331 which was called: # once (7µs+8µs) by Moose::BEGIN@15 at line 331
no strict 'refs';
# spent 15µs making 1 call to Moose::Exporter::BEGIN@331 # spent 8µs making 1 call to strict::unimport
3323019µs \&{ $package . '::' . $name };
333 };
334
3353034µs return $sub if defined &$sub;
336
337 Carp::cluck "Trying to export undefined sub ${package}::${name}";
338
339 return;
340}
341
342our $CALLER;
343
344sub _make_wrapped_sub {
345 my $self = shift;
346 my $fq_name = shift;
347 my $sub = shift;
348 my $export_recorder = shift;
349
350 # We need to set the package at import time, so that when
351 # package Foo imports has(), we capture "Foo" as the
352 # package. This lets other packages call Foo::has() and get
353 # the right package. This is done for backwards compatibility
354 # with existing production code, not because this is a good
355 # idea ;)
356 return sub {
357 my $caller = $CALLER;
358
359 my $wrapper = $self->_curry_wrapper( $sub, $fq_name, $caller );
360
361 my $sub = subname( $fq_name => $wrapper );
362
363 $export_recorder->{$sub} = 1;
364
365 return $sub;
366 };
367}
368
369
# spent 12µs within Moose::Exporter::_make_wrapped_sub_with_meta which was called 8 times, avg 1µs/call: # 8 times (12µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 265, avg 1µs/call
sub _make_wrapped_sub_with_meta {
37081µs my $self = shift;
37181µs my $fq_name = shift;
3728700ns my $sub = shift;
3738800ns my $export_recorder = shift;
3748700ns my $meta_lookup = shift;
375
376
# spent 79µs (39+39) within Moose::Exporter::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Exporter.pm:389] which was called 8 times, avg 10µs/call: # 8 times (39µs+39µs) by Sub::Exporter::default_generator at line 420 of Sub/Exporter.pm, avg 10µs/call
return sub {
37781µs my $caller = $CALLER;
378
37987µs822µs my $wrapper = $self->_late_curry_wrapper(
# spent 22µs making 8 calls to Moose::Exporter::_late_curry_wrapper, avg 3µs/call
380 $sub, $fq_name,
381 $meta_lookup => $caller
382 );
383
384827µs818µs my $sub = subname( $fq_name => $wrapper );
# spent 18µs making 8 calls to Sub::Name::subname, avg 2µs/call
385
38686µs $export_recorder->{$sub} = 1;
387
388810µs return $sub;
389812µs };
390}
391
392sub _curry_wrapper {
393 my $class = shift;
394 my $sub = shift;
395 my $fq_name = shift;
396 my @extra = @_;
397
398 my $wrapper = sub { $sub->( @extra, @_ ) };
399 if ( my $proto = prototype $sub ) {
400
401 # XXX - Perl's prototype sucks. Use & to make set_prototype
402 # ignore the fact that we're passing "private variables"
403 &Scalar::Util::set_prototype( $wrapper, $proto );
404 }
405 return $wrapper;
406}
407
408
# spent 22µs within Moose::Exporter::_late_curry_wrapper which was called 8 times, avg 3µs/call: # 8 times (22µs+0s) by Moose::Exporter::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Exporter.pm:389] at line 379, avg 3µs/call
sub _late_curry_wrapper {
40981µs my $class = shift;
41082µs my $sub = shift;
41183µs my $fq_name = shift;
4128700ns my $extra = shift;
41382µs my @ex_args = @_;
414
415
# spent 26.4ms (71µs+26.3) within Moose::has which was called 8 times, avg 3.30ms/call: # 4 times (52µs+13.1ms) by Moose::has at line 419, avg 3.29ms/call # once (6µs+7.29ms) by BenchmarkAnything::Storage::Frontend::Lib::BEGIN@280 at line 13 of DBIx/MultiStatementDo.pm # once (6µs+3.05ms) by BenchmarkAnything::Storage::Frontend::Lib::BEGIN@280 at line 19 of DBIx/MultiStatementDo.pm # once (4µs+1.84ms) by BenchmarkAnything::Storage::Frontend::Lib::BEGIN@280 at line 37 of DBIx/MultiStatementDo.pm # once (3µs+1.04ms) by BenchmarkAnything::Storage::Frontend::Lib::BEGIN@280 at line 39 of DBIx/MultiStatementDo.pm
my $wrapper = sub {
416
417 # resolve curried arguments at runtime via this closure
418419µs439µs my @curry = ( $extra->(@ex_args) );
# spent 39µs making 4 calls to Moose::Exporter::__ANON__[Moose/Exporter.pm:252], avg 10µs/call
419413µs413.2ms return $sub->( @curry, @_ );
# spent 13.2ms making 4 calls to Moose::has, avg 3.29ms/call
42086µs };
421
42282µs if ( my $proto = prototype $sub ) {
423
424 # XXX - Perl's prototype sucks. Use & to make set_prototype
425 # ignore the fact that we're passing "private variables"
426 &Scalar::Util::set_prototype( $wrapper, $proto );
427 }
428812µs return $wrapper;
429}
430
431
# spent 9µs within Moose::Exporter::_make_import_sub which was called 2 times, avg 5µs/call: # 2 times (9µs+0s) by Moose::Exporter::build_import_methods at line 62, avg 5µs/call
sub _make_import_sub {
4322400ns shift;
4332600ns my $exporting_package = shift;
4342600ns my $exporter = shift;
4352400ns my $exports_from = shift;
4362600ns my $is_reexport = shift;
4372500ns my $meta_lookup = shift;
438
439 return sub {
440
441 # I think we could use Sub::Exporter's collector feature
442 # to do this, but that would be rather gross, since that
443 # feature isn't really designed to return a value to the
444 # caller of the exporter sub.
445 #
446 # Also, this makes sure we preserve backwards compat for
447 # _get_caller, so it always sees the arguments in the
448 # expected order.
4492400ns my $traits;
45026µs229µs ( $traits, @_ ) = _strip_traits(@_);
# spent 29µs making 2 calls to Moose::Exporter::_strip_traits, avg 14µs/call
451
4522500ns my $metaclass;
45325µs211µs ( $metaclass, @_ ) = _strip_metaclass(@_);
# spent 11µs making 2 calls to Moose::Exporter::_strip_metaclass, avg 6µs/call
4542500ns $metaclass
455 = Moose::Util::resolve_metaclass_alias( 'Class' => $metaclass )
456 if defined $metaclass && length $metaclass;
457
4582300ns my $meta_name;
45925µs211µs ( $meta_name, @_ ) = _strip_meta_name(@_);
# spent 11µs making 2 calls to Moose::Exporter::_strip_meta_name, avg 5µs/call
460
461 # Normally we could look at $_[0], but in some weird cases
462 # (involving goto &Moose::import), $_[0] ends as something
463 # else (like Squirrel).
4642700ns my $class = $exporting_package;
465
46623µs26µs $CALLER = _get_caller(@_);
# spent 6µs making 2 calls to Moose::Exporter::_get_caller, avg 3µs/call
467
468 # this works because both pragmas set $^H (see perldoc
469 # perlvar) which affects the current compilation -
470 # i.e. the file who use'd us - which is why we don't need
471 # to do anything special to make it affect that file
472 # rather than this one (which is already compiled)
473
47424µs24µs strict->import;
# spent 4µs making 2 calls to strict::import, avg 2µs/call
47523µs214µs warnings->import;
# spent 14µs making 2 calls to warnings::import, avg 7µs/call
476
4772400ns my $did_init_meta;
478418µs24µs for my $c ( grep { $_->can('init_meta') } $class, @{$exports_from} ) {
# spent 4µs making 2 calls to UNIVERSAL::can, avg 2µs/call
479
480 # init_meta can apply a role, which when loaded uses
481 # Moose::Exporter, which in turn sets $CALLER, so we need
482 # to protect against that.
4831400ns local $CALLER = $CALLER;
48412µs11.83ms $c->init_meta(
# spent 1.83ms making 1 call to Moose::init_meta
485 for_class => $CALLER,
486 metaclass => $metaclass,
487 meta_name => $meta_name,
488 );
4891700ns $did_init_meta = 1;
490 }
491
492 {
493 # The metaroles will use Moose::Role, which in turn uses
494 # Moose::Exporter, which in turn sets $CALLER, so we need
495 # to protect against that.
49643µs local $CALLER = $CALLER;
49724µs264µs _apply_metaroles(
# spent 64µs making 2 calls to Moose::Exporter::_apply_metaroles, avg 32µs/call
498 $CALLER,
499 [$class, @$exports_from],
500 $meta_lookup
501 );
502 }
503
50422µs if ( $did_init_meta && @{$traits} ) {
505
506 # The traits will use Moose::Role, which in turn uses
507 # Moose::Exporter, which in turn sets $CALLER, so we need
508 # to protect against that.
509 local $CALLER = $CALLER;
510 _apply_meta_traits( $CALLER, $traits, $meta_lookup );
511 }
512 elsif ( @{$traits} ) {
513 throw_exception( ClassDoesNotHaveInitMeta => class_name => $class,
514 traits => $traits
515 );
516 }
517
51821µs my ( undef, @args ) = @_;
51921µs my $extra = shift @args if ref $args[0] eq 'HASH';
520
5212700ns $extra ||= {};
52221µs if ( !$extra->{into} ) {
52321µs $extra->{into_level} ||= 0;
5242600ns $extra->{into_level}++;
525 }
526
527210µs21.28ms $class->$exporter( $extra, @args );
# spent 1.28ms making 2 calls to Sub::Exporter::__ANON__[Sub/Exporter.pm:337], avg 641µs/call
52827µs };
529}
530
531
# spent 29µs (17+12) within Moose::Exporter::_strip_traits which was called 2 times, avg 14µs/call: # 2 times (17µs+12µs) by Moose::Util::TypeConstraints::import or Moose::import at line 450, avg 14µs/call
sub _strip_traits {
532423µs212µs my $idx = first_index { ( $_ || '' ) eq '-traits' } @_;
# spent 12µs making 2 calls to List::MoreUtils::firstidx, avg 6µs/call
533
53428µs return ( [], @_ ) unless $idx >= 0 && $#_ >= $idx + 1;
535
536 my $traits = $_[ $idx + 1 ];
537
538 splice @_, $idx, 2;
539
540 $traits = [$traits] unless ref $traits;
541
542 return ( $traits, @_ );
543}
544
545
# spent 11µs (9+2) within Moose::Exporter::_strip_metaclass which was called 2 times, avg 6µs/call: # 2 times (9µs+2µs) by Moose::Util::TypeConstraints::import or Moose::import at line 453, avg 6µs/call
sub _strip_metaclass {
54648µs22µs my $idx = first_index { ( $_ || '' ) eq '-metaclass' } @_;
# spent 2µs making 2 calls to List::MoreUtils::firstidx, avg 1µs/call
547
54824µs return ( undef, @_ ) unless $idx >= 0 && $#_ >= $idx + 1;
549
550 my $metaclass = $_[ $idx + 1 ];
551
552 splice @_, $idx, 2;
553
554 return ( $metaclass, @_ );
555}
556
557
# spent 11µs (9+2) within Moose::Exporter::_strip_meta_name which was called 2 times, avg 5µs/call: # 2 times (9µs+2µs) by Moose::Util::TypeConstraints::import or Moose::import at line 459, avg 5µs/call
sub _strip_meta_name {
55847µs22µs my $idx = first_index { ( $_ || '' ) eq '-meta_name' } @_;
# spent 2µs making 2 calls to List::MoreUtils::firstidx, avg 800ns/call
559
56024µs return ( 'meta', @_ ) unless $idx >= 0 && $#_ >= $idx + 1;
561
562 my $meta_name = $_[ $idx + 1 ];
563
564 splice @_, $idx, 2;
565
566 return ( $meta_name, @_ );
567}
568
569
# spent 64µs (18+46) within Moose::Exporter::_apply_metaroles which was called 2 times, avg 32µs/call: # 2 times (18µs+46µs) by Moose::Util::TypeConstraints::import or Moose::import at line 497, avg 32µs/call
sub _apply_metaroles {
57021µs my ($class, $exports_from, $meta_lookup) = @_;
571
57223µs232µs my $metaroles = _collect_metaroles($exports_from);
# spent 32µs making 2 calls to Moose::Exporter::_collect_metaroles, avg 16µs/call
5732800ns my $base_class_roles = delete $metaroles->{base_class_roles};
574
57524µs213µs my $meta = $meta_lookup->($class);
# spent 13µs making 2 calls to Moose::Exporter::__ANON__[Moose/Exporter.pm:39], avg 6µs/call
576 # for instance, Moose.pm uses Moose::Util::TypeConstraints
57723µs return unless $meta;
578
5791600ns Moose::Util::MetaRole::apply_metaroles(
580 for => $meta,
581 %$metaroles,
582 ) if keys %$metaroles;
583
58414µs1500ns Moose::Util::MetaRole::apply_base_class_roles(
# spent 500ns making 1 call to UNIVERSAL::isa
585 for => $meta,
586 roles => $base_class_roles,
587 ) if $meta->isa('Class::MOP::Class')
588 && $base_class_roles && @$base_class_roles;
589}
590
591
# spent 32µs within Moose::Exporter::_collect_metaroles which was called 2 times, avg 16µs/call: # 2 times (32µs+0s) by Moose::Exporter::_apply_metaroles at line 572, avg 16µs/call
sub _collect_metaroles {
5922700ns my ($exports_from) = @_;
593
594212µs my @old_style_role_types = map { "${_}_roles" } qw(
595 metaclass
596 attribute_metaclass
597 method_metaclass
598 wrapped_method_metaclass
599 instance_metaclass
600 constructor_class
601 destructor_class
602 error_class
603 );
604
6052600ns my %class_metaroles;
606 my %role_metaroles;
607 my @base_class_roles;
608 my %old_style_roles;
609
61022µs for my $exporter (@$exports_from) {
61122µs my $data = $EXPORT_SPEC{$exporter};
612
61321µs if (exists $data->{class_metaroles}) {
614 for my $type (keys %{ $data->{class_metaroles} }) {
615 push @{ $class_metaroles{$type} ||= [] },
616 @{ $data->{class_metaroles}{$type} };
617 }
618 }
619
6202600ns if (exists $data->{role_metaroles}) {
621 for my $type (keys %{ $data->{role_metaroles} }) {
622 push @{ $role_metaroles{$type} ||= [] },
623 @{ $data->{role_metaroles}{$type} };
624 }
625 }
626
6272700ns if (exists $data->{base_class_roles}) {
628 push @base_class_roles, @{ $data->{base_class_roles} };
629 }
630
63122µs for my $type (@old_style_role_types) {
632165µs if (exists $data->{$type}) {
633 push @{ $old_style_roles{$type} ||= [] },
634 @{ $data->{$type} };
635 }
636 }
637 }
638
639 return {
64028µs (keys(%class_metaroles)
641 ? (class_metaroles => \%class_metaroles)
642 : ()),
643 (keys(%role_metaroles)
644 ? (role_metaroles => \%role_metaroles)
645 : ()),
646 (@base_class_roles
647 ? (base_class_roles => \@base_class_roles)
648 : ()),
649 %old_style_roles,
650 };
651}
652
653sub _apply_meta_traits {
654 my ( $class, $traits, $meta_lookup ) = @_;
655
656 return unless @{$traits};
657
658 my $meta = $meta_lookup->($class);
659
660 my $type = $meta->isa('Moose::Meta::Role') ? 'Role'
661 : $meta->isa('Class::MOP::Class') ? 'Class'
662 : confess('Cannot determine metaclass type for '
663 . 'trait application. Meta isa '
664 . ref $meta);
665
666 my @resolved_traits = map {
667 ref $_
668 ? $_
669 : Moose::Util::resolve_metatrait_alias( $type => $_ )
670 } @$traits;
671
672 return unless @resolved_traits;
673
674 my %args = ( for => $class );
675
676 if ( $meta->isa('Moose::Meta::Role') ) {
677 $args{role_metaroles} = { role => \@resolved_traits };
678 }
679 else {
680 $args{class_metaroles} = { class => \@resolved_traits };
681 }
682
683 Moose::Util::MetaRole::apply_metaroles(%args);
684}
685
686
# spent 6µs within Moose::Exporter::_get_caller which was called 2 times, avg 3µs/call: # 2 times (6µs+0s) by Moose::Util::TypeConstraints::import or Moose::import at line 466, avg 3µs/call
sub _get_caller {
687
688 # 1 extra level because it's called by import so there's a layer
689 # of indirection
6902500ns my $offset = 1;
691
692 return
693 ( ref $_[1] && defined $_[1]->{into} ) ? $_[1]->{into}
694 : ( ref $_[1] && defined $_[1]->{into_level} )
695 ? caller( $offset + $_[1]->{into_level} )
69627µs : caller($offset);
697}
698
699
# spent 9µs within Moose::Exporter::_make_unimport_sub which was called 2 times, avg 5µs/call: # 2 times (9µs+0s) by Moose::Exporter::build_import_methods at line 70, avg 5µs/call
sub _make_unimport_sub {
7002400ns shift;
7012400ns my $exporting_package = shift;
70221µs my $exports = shift;
7032700ns my $export_recorder = shift;
7042300ns my $is_reexport = shift;
7052400ns my $meta_lookup = shift;
706
707 return sub {
7081900ns my $caller = scalar caller();
709 Moose::Exporter->_remove_keywords(
710 $caller,
71119µs146µs [ keys %{$exports} ],
# spent 46µs making 1 call to Moose::Exporter::_remove_keywords
712 $export_recorder,
713 $is_reexport,
714 );
71528µs };
716}
717
718
# spent 46µs (45+900ns) within Moose::Exporter::_remove_keywords which was called: # once (45µs+900ns) by Moose::unimport at line 711
sub _remove_keywords {
7191300ns shift;
7201600ns my $package = shift;
7211400ns my $keywords = shift;
7221200ns my $recorded_exports = shift;
7231200ns my $is_reexport = shift;
724
725238µs225µs
# spent 15µs (6+10) within Moose::Exporter::BEGIN@725 which was called: # once (6µs+10µs) by Moose::BEGIN@15 at line 725
no strict 'refs';
# spent 15µs making 1 call to Moose::Exporter::BEGIN@725 # spent 10µs making 1 call to strict::unimport
726
72714µs foreach my $name ( @{$keywords} ) {
728128µs if ( defined &{ $package . '::' . $name } ) {
729125µs my $sub = \&{ $package . '::' . $name };
730
731 # make sure it is from us
732123µs next unless $recorded_exports->{$sub};
733
734122µs if ( $is_reexport->{$name} ) {
7352165µs215µs
# spent 10µs (4+5) within Moose::Exporter::BEGIN@735 which was called: # once (4µs+5µs) by Moose::BEGIN@15 at line 735
no strict 'refs';
# spent 10µs making 1 call to Moose::Exporter::BEGIN@735 # spent 5µs making 1 call to strict::unimport
736 next
737 unless _export_is_flagged(
73828µs2900ns \*{ join q{::} => $package, $name } );
# spent 900ns making 2 calls to Moose::Exporter::_export_is_flagged, avg 450ns/call
739 }
740
741 # and if it is from us, then undef the slot
7421215µs delete ${ $package . '::' }{$name};
743 }
744 }
745}
746
747# maintain this for now for backcompat
748# make sure to return a sub to install in the same circumstances as previously
749# but this functionality now happens at the end of ->import
750
# spent 22µs within Moose::Exporter::_make_init_meta which was called 2 times, avg 11µs/call: # 2 times (22µs+0s) by Moose::Exporter::build_import_methods at line 78, avg 11µs/call
sub _make_init_meta {
7512300ns shift;
7522500ns my $class = shift;
7532500ns my $args = shift;
7542200ns my $meta_lookup = shift;
755
7562300ns my %old_style_roles;
75728µs for my $role (
758 map {"${_}_roles"}
759 qw(
760 metaclass
761 attribute_metaclass
762 method_metaclass
763 wrapped_method_metaclass
764 instance_metaclass
765 constructor_class
766 destructor_class
767 error_class
768 )
769 ) {
770 $old_style_roles{$role} = $args->{$role}
771163µs if exists $args->{$role};
772 }
773
7742300ns my %base_class_roles;
775 %base_class_roles = ( roles => $args->{base_class_roles} )
7762500ns if exists $args->{base_class_roles};
777
778 my %new_style_roles = map { $_ => $args->{$_} }
77923µs grep { exists $args->{$_} } qw( class_metaroles role_metaroles );
780
78125µs return unless %new_style_roles || %old_style_roles || %base_class_roles;
782
783 return sub {
784 shift;
785 my %opts = @_;
786 $meta_lookup->($opts{for_class});
787 };
788}
789
790
# spent 27µs (13+14) within Moose::Exporter::import which was called 2 times, avg 13µs/call: # once (7µs+9µs) by Moose::BEGIN@15 at line 15 of Moose.pm # once (6µs+4µs) by Moose::Util::TypeConstraints::BEGIN@6 at line 6 of Moose/Util/TypeConstraints.pm
sub import {
79123µs23µs strict->import;
# spent 3µs making 2 calls to strict::import, avg 2µs/call
79226µs210µs warnings->import;
# spent 10µs making 2 calls to warnings::import, avg 5µs/call
793}
794
79513µs1;
796
797# ABSTRACT: make an import() and unimport() just like Moose.pm
798
799__END__
 
# spent 7µs within Moose::Exporter::CORE:match which was called 22 times, avg 314ns/call: # 22 times (7µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 287, avg 314ns/call
sub Moose::Exporter::CORE:match; # opcode
# spent 900ns within Moose::Exporter::_export_is_flagged which was called 2 times, avg 450ns/call: # 2 times (900ns+0s) by Moose::Exporter::_remove_keywords at line 738, avg 450ns/call
sub Moose::Exporter::_export_is_flagged; # xsub
# spent 2µs within Moose::Exporter::_flag_as_reexport which was called 2 times, avg 1µs/call: # 2 times (2µs+0s) by Moose::Exporter::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/x86_64-linux/Moose/Exporter.pm:140] at line 138, avg 1µs/call
sub Moose::Exporter::_flag_as_reexport; # xsub