| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm |
| Statements | Executed 25903 statements in 261ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 100 | 1 | 1 | 62.8ms | 539ms | Moose::Exporter::__ANON__[:125] |
| 752 | 1 | 1 | 41.8ms | 81.2ms | Moose::Exporter::__ANON__[:329] |
| 48 | 1 | 1 | 33.0ms | 33.7ms | Moose::Exporter::_remove_keywords |
| 752 | 1 | 1 | 29.1ms | 29.1ms | Moose::Exporter::_late_curry_wrapper |
| 100 | 100 | 96 | 23.9ms | 1.73s | Moose::Exporter::__ANON__[:456] |
| 1 | 1 | 1 | 20.3ms | 417ms | Moose::Exporter::BEGIN@11 |
| 616 | 1 | 1 | 5.36ms | 5.36ms | Moose::Exporter::__ANON__[:259] |
| 216 | 1 | 1 | 4.97ms | 12.8ms | Moose::Exporter::__ANON__[:321] |
| 100 | 1 | 1 | 4.45ms | 6.34ms | Moose::Exporter::_strip_traits |
| 1 | 1 | 1 | 3.61ms | 4.61ms | Moose::Exporter::BEGIN@13 |
| 100 | 1 | 1 | 3.28ms | 4.43ms | Moose::Exporter::_strip_metaclass |
| 100 | 1 | 1 | 3.24ms | 4.37ms | Moose::Exporter::_strip_meta_name |
| 48 | 48 | 47 | 2.31ms | 36.0ms | Moose::Exporter::__ANON__[:557] |
| 3 | 1 | 1 | 1.98ms | 3.58ms | Moose::Exporter::_make_sub_exporter_params |
| 100 | 1 | 1 | 1.60ms | 1.60ms | Moose::Exporter::_get_caller |
| 186 | 1 | 1 | 1.36ms | 1.36ms | Moose::Exporter::_flag_as_reexport (xsub) |
| 39 | 2 | 1 | 1.05ms | 1.05ms | Moose::Exporter::_sub_from_package |
| 3 | 1 | 1 | 828µs | 15.2ms | Moose::Exporter::build_import_methods |
| 94 | 1 | 1 | 621µs | 621µs | Moose::Exporter::_export_is_flagged (xsub) |
| 16 | 1 | 1 | 437µs | 437µs | Moose::Exporter::_make_wrapped_sub_with_meta |
| 3 | 1 | 1 | 269µs | 269µs | Moose::Exporter::_make_init_meta |
| 3 | 1 | 1 | 182µs | 293µs | Moose::Exporter::_follow_also |
| 3 | 3 | 3 | 178µs | 15.4ms | Moose::Exporter::setup_import_methods |
| 3 | 1 | 1 | 172µs | 7.26ms | Moose::Exporter::_make_exporter |
| 3 | 3 | 3 | 133µs | 393µs | Moose::Exporter::import |
| 3 | 1 | 1 | 124µs | 124µs | Moose::Exporter::_make_import_sub |
| 1 | 1 | 1 | 114µs | 141µs | Moose::Exporter::BEGIN@3 |
| 3 | 1 | 1 | 86µs | 86µs | Moose::Exporter::_make_unimport_sub |
| 3 | 1 | 1 | 80µs | 80µs | Moose::Exporter::_parse_trait_aliases |
| 1 | 1 | 1 | 69µs | 786µs | Moose::Exporter::BEGIN@15 |
| 1 | 1 | 1 | 64µs | 163µs | Moose::Exporter::BEGIN@4 |
| 3 | 1 | 1 | 62µs | 62µs | Moose::Exporter::_follow_also_real |
| 1 | 1 | 1 | 44µs | 270µs | Moose::Exporter::BEGIN@12 |
| 1 | 1 | 1 | 44µs | 119µs | Moose::Exporter::BEGIN@272 |
| 1 | 1 | 1 | 44µs | 210µs | Moose::Exporter::BEGIN@14 |
| 1 | 1 | 1 | 43µs | 119µs | Moose::Exporter::BEGIN@567 |
| 1 | 1 | 1 | 42µs | 113µs | Moose::Exporter::BEGIN@120 |
| 1 | 1 | 1 | 41µs | 200µs | Moose::Exporter::BEGIN@16 |
| 1 | 1 | 1 | 39µs | 104µs | Moose::Exporter::BEGIN@121 |
| 1 | 1 | 1 | 38µs | 99µs | Moose::Exporter::BEGIN@577 |
| 1 | 1 | 1 | 24µs | 24µs | Moose::Exporter::BEGIN@18 |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::__ANON__[:189] |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::__ANON__[:307] |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::__ANON__[:338] |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::__ANON__[:360] |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::__ANON__[:460] |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::__ANON__[:474] |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::__ANON__[:486] |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::__ANON__[:643] |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::_apply_meta_traits |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::_curry_wrapper |
| 0 | 0 | 0 | 0s | 0s | Moose::Exporter::_make_wrapped_sub |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Exporter; | ||||
| 2 | |||||
| 3 | 3 | 167µs | 2 | 168µs | # spent 141µs (114+27) within Moose::Exporter::BEGIN@3 which was called:
# once (114µs+27µs) by Moose::BEGIN@15 at line 3 # spent 141µs making 1 call to Moose::Exporter::BEGIN@3
# spent 27µs making 1 call to strict::import |
| 4 | 3 | 369µs | 2 | 261µs | # spent 163µs (64+98) within Moose::Exporter::BEGIN@4 which was called:
# once (64µs+98µs) by Moose::BEGIN@15 at line 4 # spent 163µs making 1 call to Moose::Exporter::BEGIN@4
# spent 98µs making 1 call to warnings::import |
| 5 | |||||
| 6 | 1 | 4µs | our $VERSION = '1.19'; | ||
| 7 | 1 | 3µs | our $XS_VERSION = $VERSION; | ||
| 8 | 1 | 69µs | $VERSION = eval $VERSION; # spent 12µs executing statements in string eval | ||
| 9 | 1 | 3µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 10 | |||||
| 11 | 3 | 744µs | 1 | 417ms | # spent 417ms (20.3+397) within Moose::Exporter::BEGIN@11 which was called:
# once (20.3ms+397ms) by Moose::BEGIN@15 at line 11 # spent 417ms making 1 call to Moose::Exporter::BEGIN@11 |
| 12 | 3 | 119µs | 2 | 496µs | # spent 270µs (44+226) within Moose::Exporter::BEGIN@12 which was called:
# once (44µs+226µs) by Moose::BEGIN@15 at line 12 # spent 270µs making 1 call to Moose::Exporter::BEGIN@12
# spent 226µs making 1 call to Exporter::import |
| 13 | 3 | 744µs | 1 | 4.61ms | # spent 4.61ms (3.61+994µs) within Moose::Exporter::BEGIN@13 which was called:
# once (3.61ms+994µs) by Moose::BEGIN@15 at line 13 # spent 4.61ms making 1 call to Moose::Exporter::BEGIN@13 |
| 14 | 3 | 110µs | 2 | 376µs | # spent 210µs (44+166) within Moose::Exporter::BEGIN@14 which was called:
# once (44µs+166µs) by Moose::BEGIN@15 at line 14 # spent 210µs making 1 call to Moose::Exporter::BEGIN@14
# spent 166µs making 1 call to Exporter::import |
| 15 | 3 | 252µs | 3 | 1.50ms | # spent 786µs (69+717) within Moose::Exporter::BEGIN@15 which was called:
# once (69µs+717µs) by Moose::BEGIN@15 at line 15 # spent 786µs making 1 call to Moose::Exporter::BEGIN@15
# spent 659µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
# spent 58µs making 1 call to UNIVERSAL::VERSION |
| 16 | 3 | 104µs | 2 | 359µs | # spent 200µs (41+159) within Moose::Exporter::BEGIN@16 which was called:
# once (41µs+159µs) by Moose::BEGIN@15 at line 16 # spent 200µs making 1 call to Moose::Exporter::BEGIN@16
# spent 159µs making 1 call to Exporter::import |
| 17 | |||||
| 18 | 3 | 1.47ms | 1 | 24µs | # spent 24µs within Moose::Exporter::BEGIN@18 which was called:
# once (24µs+0s) by Moose::BEGIN@15 at line 18 # spent 24µs making 1 call to Moose::Exporter::BEGIN@18 |
| 19 | |||||
| 20 | 1 | 303µs | 1 | 273µs | XSLoader::load( 'Moose', $XS_VERSION ); # spent 273µs making 1 call to XSLoader::load |
| 21 | |||||
| 22 | 1 | 2µs | my %EXPORT_SPEC; | ||
| 23 | |||||
| 24 | # spent 15.4ms (178µs+15.2) within Moose::Exporter::setup_import_methods which was called 3 times, avg 5.13ms/call:
# once (66µs+5.64ms) by Moose::Meta::Attribute::BEGIN@20 at line 42 of Moose/Util/TypeConstraints.pm
# once (55µs+5.00ms) by KiokuDB::Backend::BEGIN@4 at line 88 of Moose/Role.pm
# once (57µs+4.56ms) by KiokuDB::BEGIN@4 at line 122 of Moose.pm | ||||
| 25 | 9 | 178µs | my ( $class, %args ) = @_; | ||
| 26 | |||||
| 27 | my $exporting_package = $args{exporting_package} ||= caller(); | ||||
| 28 | |||||
| 29 | 3 | 15.2ms | $class->build_import_methods( # spent 15.2ms making 3 calls to Moose::Exporter::build_import_methods, avg 5.07ms/call | ||
| 30 | %args, | ||||
| 31 | install => [qw(import unimport init_meta)] | ||||
| 32 | ); | ||||
| 33 | } | ||||
| 34 | |||||
| 35 | # spent 15.2ms (828µs+14.4) within Moose::Exporter::build_import_methods which was called 3 times, avg 5.07ms/call:
# 3 times (828µs+14.4ms) by Moose::Exporter::setup_import_methods at line 29, avg 5.07ms/call | ||||
| 36 | 69 | 748µs | my ( $class, %args ) = @_; | ||
| 37 | |||||
| 38 | my $exporting_package = $args{exporting_package} ||= caller(); | ||||
| 39 | |||||
| 40 | $EXPORT_SPEC{$exporting_package} = \%args; | ||||
| 41 | |||||
| 42 | 3 | 293µs | my @exports_from = $class->_follow_also($exporting_package); # spent 293µs making 3 calls to Moose::Exporter::_follow_also, avg 98µs/call | ||
| 43 | |||||
| 44 | my $export_recorder = {}; | ||||
| 45 | my $is_reexport = {}; | ||||
| 46 | |||||
| 47 | 3 | 3.58ms | my $exports = $class->_make_sub_exporter_params( # spent 3.58ms making 3 calls to Moose::Exporter::_make_sub_exporter_params, avg 1.19ms/call | ||
| 48 | [ @exports_from, $exporting_package ], | ||||
| 49 | $export_recorder, | ||||
| 50 | $is_reexport, | ||||
| 51 | ); | ||||
| 52 | |||||
| 53 | 3 | 7.26ms | my $exporter = $class->_make_exporter($exports, $is_reexport); # spent 7.26ms making 3 calls to Moose::Exporter::_make_exporter, avg 2.42ms/call | ||
| 54 | |||||
| 55 | my %methods; | ||||
| 56 | 3 | 124µs | $methods{import} = $class->_make_import_sub( # spent 124µs making 3 calls to Moose::Exporter::_make_import_sub, avg 41µs/call | ||
| 57 | $exporting_package, | ||||
| 58 | $exporter, | ||||
| 59 | \@exports_from, | ||||
| 60 | $is_reexport | ||||
| 61 | ); | ||||
| 62 | |||||
| 63 | 3 | 86µs | $methods{unimport} = $class->_make_unimport_sub( # spent 86µ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 | |||||
| 70 | 3 | 269µs | $methods{init_meta} = $class->_make_init_meta( # spent 269µs making 3 calls to Moose::Exporter::_make_init_meta, avg 90µs/call | ||
| 71 | $exporting_package, | ||||
| 72 | \%args | ||||
| 73 | ); | ||||
| 74 | |||||
| 75 | 3 | 502µs | my $package = Class::MOP::Package->initialize($exporting_package); # spent 502µs making 3 calls to Class::MOP::Package::initialize, avg 167µs/call | ||
| 76 | for my $to_install ( @{ $args{install} || [] } ) { | ||||
| 77 | my $symbol = '&' . $to_install; | ||||
| 78 | next | ||||
| 79 | 6 | 1000µs | unless $methods{$to_install} # spent 1000µs making 6 calls to Class::MOP::Package::has_package_symbol, avg 167µs/call | ||
| 80 | && !$package->has_package_symbol($symbol); | ||||
| 81 | 6 | 1.25ms | $package->add_package_symbol( $symbol, $methods{$to_install} ); # spent 1.25ms making 6 calls to Class::MOP::Package::add_package_symbol, avg 209µs/call | ||
| 82 | } | ||||
| 83 | |||||
| 84 | return ( $methods{import}, $methods{unimport}, $methods{init_meta} ); | ||||
| 85 | } | ||||
| 86 | |||||
| 87 | # spent 7.26ms (172µs+7.09) within Moose::Exporter::_make_exporter which was called 3 times, avg 2.42ms/call:
# 3 times (172µs+7.09ms) by Moose::Exporter::build_import_methods at line 53, avg 2.42ms/call | ||||
| 88 | 6 | 170µs | my ($class, $exports, $is_reexport) = @_; | ||
| 89 | |||||
| 90 | return Sub::Exporter::build_exporter( | ||||
| 91 | { | ||||
| 92 | exports => $exports, | ||||
| 93 | groups => { default => [':all'] }, | ||||
| 94 | # spent 539ms (62.8+476) within Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:125] which was called 100 times, avg 5.39ms/call:
# 100 times (62.8ms+476ms) by Sub::Exporter::_do_import at line 799 of Sub/Exporter.pm, avg 5.39ms/call | ||||
| 95 | 6594 | 60.4ms | my ($arg, $to_export) = @_; | ||
| 96 | 100 | 3.74ms | my $meta = Class::MOP::class_of($arg->{into}); # spent 3.74ms making 100 calls to Class::MOP::class_of, avg 37µs/call | ||
| 97 | |||||
| 98 | 2 | 8.65ms | goto &Sub::Exporter::default_installer unless $meta; # spent 8.65ms making 2 calls to Sub::Exporter::default_installer, avg 4.32ms/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 | |||||
| 104 | my @filtered_to_export; | ||||
| 105 | my %installed; | ||||
| 106 | for (my $i = 0; $i < @{ $to_export }; $i += 2) { | ||||
| 107 | my ($as, $cv) = @{ $to_export }[$i, $i + 1]; | ||||
| 108 | |||||
| 109 | 1336 | 150ms | next if !ref($as) # spent 150ms making 1334 calls to Class::MOP::Package::has_package_symbol, avg 112µs/call
# spent 237µs making 2 calls to Class::MOP::Package::get_package_symbol, avg 119µs/call | ||
| 110 | && $meta->has_package_symbol('&' . $as) | ||||
| 111 | && $meta->get_package_symbol('&' . $as) == $cv; | ||||
| 112 | |||||
| 113 | push @filtered_to_export, $as, $cv; | ||||
| 114 | $installed{$as} = 1 unless ref $as; | ||||
| 115 | } | ||||
| 116 | |||||
| 117 | 98 | 321ms | Sub::Exporter::default_installer($arg, \@filtered_to_export); # spent 321ms making 98 calls to Sub::Exporter::default_installer, avg 3.28ms/call | ||
| 118 | |||||
| 119 | for my $name ( keys %{$is_reexport} ) { | ||||
| 120 | 3 | 104µs | 2 | 185µs | # spent 113µs (42+72) within Moose::Exporter::BEGIN@120 which was called:
# once (42µs+72µs) by Moose::BEGIN@15 at line 120 # spent 113µs making 1 call to Moose::Exporter::BEGIN@120
# spent 72µs making 1 call to strict::unimport |
| 121 | 3 | 2.59ms | 2 | 168µ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 # spent 104µs making 1 call to Moose::Exporter::BEGIN@121
# spent 64µs making 1 call to warnings::unimport |
| 122 | next unless exists $installed{$name}; | ||||
| 123 | 186 | 1.36ms | _flag_as_reexport( \*{ join q{::}, $arg->{into}, $name } ); # spent 1.36ms making 186 calls to Moose::Exporter::_flag_as_reexport, avg 7µs/call | ||
| 124 | } | ||||
| 125 | }, | ||||
| 126 | } | ||||
| 127 | 3 | 7.09ms | ); # spent 7.09ms making 3 calls to Sub::Exporter::build_exporter, avg 2.36ms/call | ||
| 128 | } | ||||
| 129 | |||||
| 130 | { | ||||
| 131 | 2 | 9µs | my $seen = {}; | ||
| 132 | |||||
| 133 | # spent 293µs (182+111) within Moose::Exporter::_follow_also which was called 3 times, avg 98µs/call:
# 3 times (182µs+111µs) by Moose::Exporter::build_import_methods at line 42, avg 98µs/call | ||||
| 134 | 12 | 194µs | my $class = shift; | ||
| 135 | my $exporting_package = shift; | ||||
| 136 | |||||
| 137 | local %$seen = ( $exporting_package => 1 ); | ||||
| 138 | |||||
| 139 | 6 | 111µs | return uniq( _follow_also_real($exporting_package) ); # spent 62µs making 3 calls to Moose::Exporter::_follow_also_real, avg 20µs/call
# spent 50µ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 20µs/call:
# 3 times (62µs+0s) by Moose::Exporter::_follow_also at line 139, avg 20µs/call | ||||
| 143 | 12 | 110µs | my $exporting_package = shift; | ||
| 144 | |||||
| 145 | 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 | |||||
| 153 | my $also = $EXPORT_SPEC{$exporting_package}{also}; | ||||
| 154 | |||||
| 155 | 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 80µs within Moose::Exporter::_parse_trait_aliases which was called 3 times, avg 27µs/call:
# 3 times (80µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 233, avg 27µs/call | ||||
| 172 | 15 | 97µs | my $class = shift; | ||
| 173 | my ($package, $aliases) = @_; | ||||
| 174 | |||||
| 175 | my @ret; | ||||
| 176 | 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 | |||||
| 192 | return @ret; | ||||
| 193 | } | ||||
| 194 | |||||
| 195 | # spent 3.58ms (1.98+1.60) within Moose::Exporter::_make_sub_exporter_params which was called 3 times, avg 1.19ms/call:
# 3 times (1.98ms+1.60ms) by Moose::Exporter::build_import_methods at line 47, avg 1.19ms/call | ||||
| 196 | 254 | 1.81ms | my $class = shift; | ||
| 197 | my $packages = shift; | ||||
| 198 | my $export_recorder = shift; | ||||
| 199 | my $is_reexport = shift; | ||||
| 200 | |||||
| 201 | my %exports; | ||||
| 202 | |||||
| 203 | for my $package ( @{$packages} ) { | ||||
| 204 | my $args = $EXPORT_SPEC{$package} | ||||
| 205 | or die "The $package package does not use Moose::Exporter\n"; | ||||
| 206 | |||||
| 207 | for my $name ( @{ $args->{with_meta} } ) { | ||||
| 208 | 16 | 427µs | my $sub = $class->_sub_from_package( $package, $name ) # spent 427µs making 16 calls to Moose::Exporter::_sub_from_package, avg 27µs/call | ||
| 209 | or next; | ||||
| 210 | |||||
| 211 | my $fq_name = $package . '::' . $name; | ||||
| 212 | |||||
| 213 | 16 | 437µs | $exports{$name} = $class->_make_wrapped_sub_with_meta( # spent 437µs making 16 calls to Moose::Exporter::_make_wrapped_sub_with_meta, avg 27µs/call | ||
| 214 | $fq_name, | ||||
| 215 | $sub, | ||||
| 216 | $export_recorder, | ||||
| 217 | ); | ||||
| 218 | } | ||||
| 219 | |||||
| 220 | 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 | |||||
| 233 | 3 | 80µs | my @extra_exports = $class->_parse_trait_aliases( # spent 80µs making 3 calls to Moose::Exporter::_parse_trait_aliases, avg 27µs/call | ||
| 234 | $package, $args->{trait_aliases}, | ||||
| 235 | ); | ||||
| 236 | for my $name ( @{ $args->{as_is} }, @extra_exports ) { | ||||
| 237 | my ( $sub, $coderef_name ); | ||||
| 238 | |||||
| 239 | if ( ref $name ) { | ||||
| 240 | $sub = $name; | ||||
| 241 | |||||
| 242 | my $coderef_pkg; | ||||
| 243 | 4 | 34µs | ( $coderef_pkg, $coderef_name ) # spent 34µs making 4 calls to Class::MOP::get_code_info, avg 8µs/call | ||
| 244 | = Class::MOP::get_code_info($name); | ||||
| 245 | |||||
| 246 | if ( $coderef_pkg ne $package ) { | ||||
| 247 | $is_reexport->{$coderef_name} = 1; | ||||
| 248 | } | ||||
| 249 | } | ||||
| 250 | else { | ||||
| 251 | 23 | 626µs | $sub = $class->_sub_from_package( $package, $name ) # spent 626µs making 23 calls to Moose::Exporter::_sub_from_package, avg 27µs/call | ||
| 252 | or next; | ||||
| 253 | |||||
| 254 | $coderef_name = $name; | ||||
| 255 | } | ||||
| 256 | |||||
| 257 | $export_recorder->{$sub} = 1; | ||||
| 258 | |||||
| 259 | 616 | 7.28ms | # spent 5.36ms within Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:259] which was called 616 times, avg 9µs/call:
# 616 times (5.36ms+0s) by Sub::Exporter::default_generator at line 856 of Sub/Exporter.pm, avg 9µs/call | ||
| 260 | } | ||||
| 261 | } | ||||
| 262 | |||||
| 263 | return \%exports; | ||||
| 264 | } | ||||
| 265 | |||||
| 266 | sub _sub_from_package { | ||||
| 267 | 234 | 1.19ms | my $sclass = shift; | ||
| 268 | my $package = shift; | ||||
| 269 | my $name = shift; | ||||
| 270 | |||||
| 271 | my $sub = do { | ||||
| 272 | 3 | 4.71ms | 2 | 193µs | # spent 119µs (44+74) within Moose::Exporter::BEGIN@272 which was called:
# once (44µs+74µs) by Moose::BEGIN@15 at line 272 # spent 119µs making 1 call to Moose::Exporter::BEGIN@272
# spent 74µs making 1 call to strict::unimport |
| 273 | \&{ $package . '::' . $name }; | ||||
| 274 | }; | ||||
| 275 | |||||
| 276 | return $sub if defined &$sub; | ||||
| 277 | |||||
| 278 | Carp::cluck "Trying to export undefined sub ${package}::${name}"; | ||||
| 279 | |||||
| 280 | return; | ||||
| 281 | } | ||||
| 282 | |||||
| 283 | 1 | 2µs | our $CALLER; | ||
| 284 | |||||
| 285 | sub _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 437µs within Moose::Exporter::_make_wrapped_sub_with_meta which was called 16 times, avg 27µs/call:
# 16 times (437µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 213, avg 27µs/call | ||||
| 311 | 80 | 496µs | my $self = shift; | ||
| 312 | my $fq_name = shift; | ||||
| 313 | my $sub = shift; | ||||
| 314 | my $export_recorder = shift; | ||||
| 315 | |||||
| 316 | # spent 81.2ms (41.8+39.4) within Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:329] which was called 752 times, avg 108µs/call:
# 752 times (41.8ms+39.4ms) by Sub::Exporter::default_generator at line 856 of Sub/Exporter.pm, avg 108µs/call | ||||
| 317 | 3760 | 50.3ms | my $caller = $CALLER; | ||
| 318 | |||||
| 319 | my $wrapper = $self->_late_curry_wrapper( | ||||
| 320 | $sub, $fq_name, | ||||
| 321 | 216 | 4.82ms | 968 | 36.9ms | # spent 12.8ms (4.97+7.82) within Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:321] which was called 216 times, avg 59µs/call:
# 216 times (4.97ms+7.82ms) 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 59µs/call # spent 29.1ms making 752 calls to Moose::Exporter::_late_curry_wrapper, avg 39µs/call
# spent 7.82ms making 216 calls to Class::MOP::class_of, avg 36µs/call |
| 322 | ); | ||||
| 323 | |||||
| 324 | 752 | 10.3ms | my $sub = subname( $fq_name => $wrapper ); # spent 10.3ms making 752 calls to Sub::Name::subname, avg 14µs/call | ||
| 325 | |||||
| 326 | $export_recorder->{$sub} = 1; | ||||
| 327 | |||||
| 328 | return $sub; | ||||
| 329 | }; | ||||
| 330 | } | ||||
| 331 | |||||
| 332 | sub _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 29.1ms within Moose::Exporter::_late_curry_wrapper which was called 752 times, avg 39µs/call:
# 752 times (29.1ms+0s) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:329] at line 321, avg 39µs/call | ||||
| 349 | 6016 | 32.8ms | my $class = shift; | ||
| 350 | my $sub = shift; | ||||
| 351 | my $fq_name = shift; | ||||
| 352 | my $extra = shift; | ||||
| 353 | my @ex_args = @_; | ||||
| 354 | |||||
| 355 | my $wrapper = sub { | ||||
| 356 | |||||
| 357 | # resolve curried arguments at runtime via this closure | ||||
| 358 | 432 | 9.22ms | 216 | 12.8ms | my @curry = ( $extra->(@ex_args) ); # spent 12.8ms making 216 calls to Moose::Exporter::__ANON__[Moose/Exporter.pm:321], avg 59µs/call |
| 359 | 216 | 7.46s | return $sub->( @curry, @_ ); # spent 4.17s making 108 calls to Moose::has, avg 38.6ms/call
# spent 2.83s making 51 calls to Moose::Role::with, avg 55.5ms/call, recursion: max depth 3, sum of overlapping time 793ms
# spent 1.26s making 13 calls to Moose::with, avg 96.7ms/call, recursion: max depth 1, sum of overlapping time 33.0ms
# spent 10.5ms making 15 calls to Moose::Role::requires, avg 697µs/call
# spent 5.90ms making 1 call to Moose::extends
# spent 5.59ms making 7 calls to Moose::Role::has, avg 798µs/call
# spent 2.78ms making 13 calls to Moose::Role::around, avg 214µs/call
# spent 1.53ms making 4 calls to Moose::Role::override, avg 383µs/call
# spent 1.39ms making 1 call to Moose::before
# spent 436µs making 2 calls to Moose::Role::before, avg 218µs/call
# spent 227µs making 1 call to Moose::Role::after | ||
| 360 | }; | ||||
| 361 | |||||
| 362 | 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 | } | ||||
| 368 | return $wrapper; | ||||
| 369 | } | ||||
| 370 | |||||
| 371 | # spent 124µs within Moose::Exporter::_make_import_sub which was called 3 times, avg 41µs/call:
# 3 times (124µs+0s) by Moose::Exporter::build_import_methods at line 56, avg 41µs/call | ||||
| 372 | 18 | 135µs | shift; | ||
| 373 | my $exporting_package = shift; | ||||
| 374 | my $exporter = shift; | ||||
| 375 | my $exports_from = shift; | ||||
| 376 | my $is_reexport = shift; | ||||
| 377 | |||||
| 378 | # spent 1.73s (23.9ms+1.70) within Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:456] which was called 100 times, avg 17.3ms/call:
# once (229µs+38.5ms) by Moose::Meta::Attribute::Native::Trait::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait.pm
# once (253µs+27.2ms) by KiokuDB::Collapser::BEGIN@4 at line 4 of KiokuDB/Collapser.pm
# once (259µs+26.2ms) by Moose::Meta::Method::Accessor::Native::Hash::delete::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Hash/delete.pm
# once (228µs+25.2ms) by KiokuDB::LiveObjects::BEGIN@4 at line 4 of KiokuDB/LiveObjects.pm
# once (254µs+25.2ms) by KiokuDB::BEGIN@4 at line 4 of KiokuDB.pm
# once (229µs+24.9ms) by Data::Stream::Bulk::Cat::BEGIN@10 at line 10 of Data/Stream/Bulk/Cat.pm
# once (266µs+24.5ms) by KiokuDB::Entry::Skip::BEGIN@4 at line 4 of KiokuDB/Entry/Skip.pm
# once (231µs+24.2ms) by KiokuDB::TypeMap::Entry::Alias::BEGIN@4 at line 4 of KiokuDB/TypeMap/Entry/Alias.pm
# once (234µs+23.4ms) by Devel::PartialDump::BEGIN@4 at line 4 of Devel/PartialDump.pm
# once (230µs+23.4ms) by KiokuDB::Error::UnknownObjects::BEGIN@2 at line 2 of KiokuDB/Error/UnknownObjects.pm
# once (228µs+23.1ms) by Data::Stream::Bulk::Filter::BEGIN@10 at line 10 of Data/Stream/Bulk/Filter.pm
# once (230µs+22.8ms) by Data::Visitor::BEGIN@4 at line 4 of Data/Visitor.pm
# once (232µs+22.8ms) by KiokuDB::TypeMap::Shadow::BEGIN@4 at line 4 of KiokuDB/TypeMap/Shadow.pm
# once (279µs+22.7ms) by KiokuDB::Stream::Objects::BEGIN@4 at line 4 of KiokuDB/Stream/Objects.pm
# once (267µs+22.7ms) by KiokuDB::LiveObjects::TXNScope::BEGIN@4 at line 4 of KiokuDB/LiveObjects/TXNScope.pm
# once (228µs+22.8ms) by KiokuDB::TypeMap::BEGIN@4 at line 4 of KiokuDB/TypeMap.pm
# once (241µs+22.7ms) by Data::Stream::Bulk::Nil::BEGIN@10 at line 10 of Data/Stream/Bulk/Nil.pm
# once (229µs+22.7ms) by KiokuDB::Linker::BEGIN@4 at line 4 of KiokuDB/Linker.pm
# once (229µs+22.7ms) by KiokuDB::Thunk::BEGIN@4 at line 4 of KiokuDB/Thunk.pm
# once (231µs+22.6ms) by KiokuDB::TypeMap::Entry::Compiled::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Compiled.pm
# once (230µs+22.6ms) by KiokuDB::LiveObjects::Scope::BEGIN@4 at line 4 of KiokuDB/LiveObjects/Scope.pm
# once (228µs+22.6ms) by KiokuDB::TypeMap::Resolver::BEGIN@4 at line 4 of KiokuDB/TypeMap/Resolver.pm
# once (229µs+22.5ms) by KiokuDB::Error::MissingObjects::BEGIN@2 at line 2 of KiokuDB/Error/MissingObjects.pm
# once (229µs+22.5ms) by KiokuDB::TypeMap::Entry::MOP::BEGIN@4 at line 4 of KiokuDB/TypeMap/Entry/MOP.pm
# once (230µs+22.4ms) by KiokuDB::Reference::BEGIN@4 at line 4 of KiokuDB/Reference.pm
# once (230µs+22.3ms) by KiokuDB::Collapser::Buffer::BEGIN@2 at line 2 of KiokuDB/Collapser/Buffer.pm
# once (225µs+22.1ms) by KiokuDB::Entry::BEGIN@4 at line 4 of KiokuDB/Entry.pm
# once (324µs+20.4ms) by KiokuDB::TypeMap::Entry::Std::ID::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Std/ID.pm
# once (306µs+19.7ms) by Moose::Meta::Method::Accessor::Native::Array::insert::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/insert.pm
# once (241µs+17.7ms) by Moose::Meta::Method::Accessor::Native::Array::grep::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/grep.pm
# once (293µs+17.1ms) by Throwable::BEGIN@5 at line 5 of Throwable.pm
# once (348µs+16.9ms) by Moose::Meta::Method::Accessor::Native::Array::splice::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/splice.pm
# once (237µs+16.6ms) by Moose::Meta::Method::Accessor::Native::Hash::clear::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Hash/clear.pm
# once (306µs+16.4ms) by KiokuDB::TypeMap::Entry::Std::Compile::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Std/Compile.pm
# once (242µs+16.1ms) by Moose::Meta::Method::Accessor::Native::Array::first::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor/Native/Array/first.pm
# once (231µs+15.2ms) by KiokuDB::Error::BEGIN@2 at line 2 of KiokuDB/Error.pm
# once (263µs+15.1ms) by KiokuDB::TypeMap::Entry::BEGIN@4 at line 4 of KiokuDB/TypeMap/Entry.pm
# once (248µs+15.0ms) by KiokuDB::Backend::BEGIN@4 at line 4 of KiokuDB/Backend.pm
# once (229µs+14.9ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait/Array.pm
# once (229µs+14.9ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait/Hash.pm
# once (244µs+14.8ms) by KiokuDB::TypeMap::Entry::Std::Intrinsic::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Std/Intrinsic.pm
# once (229µs+14.8ms) by Moose::Meta::Method::Accessor::Native::Array::Writer::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/Writer.pm
# once (303µs+14.7ms) by Moose::Meta::Method::Accessor::Native::Array::clear::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/clear.pm
# once (228µs+14.7ms) by Moose::Meta::Method::Accessor::Native::Array::elements::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/elements.pm
# once (226µs+14.6ms) by Moose::Meta::Method::Accessor::Native::Array::BEGIN@6 at line 6 of Moose/Meta/Method/Accessor/Native/Array.pm
# once (265µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Hash::count::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/count.pm
# once (228µs+14.6ms) by Moose::Meta::Method::Accessor::Native::Array::set::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/set.pm
# once (228µs+14.6ms) by Moose::Meta::Method::Accessor::Native::Array::map::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/map.pm
# once (228µs+14.6ms) by Moose::Meta::Method::Accessor::Native::Writer::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Writer.pm
# once (235µs+14.6ms) by Moose::Meta::Method::Accessor::Native::Array::get::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/get.pm
# once (243µs+14.5ms) by KiokuDB::Role::API::BEGIN@2 at line 2 of KiokuDB/Role/API.pm
# once (229µs+14.5ms) by MooseX::Clone::BEGIN@4 at line 4 of MooseX/Clone.pm
# once (229µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Array::is_empty::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/is_empty.pm
# once (227µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Array::sort_in_place::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm
# once (229µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Array::push::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/push.pm
# once (244µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Hash::keys::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/keys.pm
# once (232µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Array::delete::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/delete.pm
# once (234µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Array::reduce::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor/Native/Array/reduce.pm
# once (229µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Array::accessor::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/accessor.pm
# once (233µs+14.5ms) by KiokuDB::TypeMap::Entry::Std::BEGIN@4 at line 4 of KiokuDB/TypeMap/Entry/Std.pm
# once (235µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Hash::elements::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/elements.pm
# once (241µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Array::sort::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/sort.pm
# once (345µs+14.4ms) by KiokuDB::TypeMap::Entry::Std::Expand::BEGIN@2 at line 2 of KiokuDB/TypeMap/Entry/Std/Expand.pm
# once (229µs+14.5ms) by Moose::Meta::Method::Accessor::Native::Array::pop::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/pop.pm
# once (231µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Array::shift::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/shift.pm
# once (231µs+14.4ms) by KiokuDB::Role::UUIDs::LibUUID::BEGIN@4 at line 4 of KiokuDB/Role/UUIDs/LibUUID.pm
# once (231µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Array::natatime::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor/Native/Array/natatime.pm
# once (230µs+14.4ms) by Data::Stream::Bulk::BEGIN@10 at line 10 of Data/Stream/Bulk.pm
# once (237µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Hash::accessor::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Hash/accessor.pm
# once (227µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Array::join::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/join.pm
# once (227µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Array::uniq::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/uniq.pm
# once (230µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Array::shuffle::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Array/shuffle.pm
# once (229µs+14.4ms) by KiokuDB::Role::TypeMap::BEGIN@4 at line 4 of KiokuDB/Role/TypeMap.pm
# once (229µs+14.4ms) by KiokuDB::Role::UUIDs::BEGIN@4 at line 4 of KiokuDB/Role/UUIDs.pm
# once (228µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Array::count::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/count.pm
# once (226µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Hash::is_empty::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm
# once (245µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Array::unshift::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/unshift.pm
# once (232µs+14.4ms) by MooseX::Clone::Meta::Attribute::Trait::NoClone::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/NoClone.pm
# once (229µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Hash::get::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/get.pm
# once (228µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Hash::Writer::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/Writer.pm
# once (227µs+14.4ms) by Moose::Meta::Method::Accessor::Native::Collection::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Collection.pm
# once (229µs+14.3ms) by MooseX::Clone::Meta::Attribute::Trait::Copy::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/Copy.pm
# once (226µs+14.3ms) by Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor/Native/Hash/set.pm
# once (227µs+14.3ms) by Moose::Meta::Method::Accessor::Native::Hash::exists::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/exists.pm
# once (245µs+14.3ms) by Moose::Meta::Method::Accessor::Native::Hash::values::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/values.pm
# once (226µs+14.3ms) by Moose::Meta::Method::Accessor::Native::Hash::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Hash.pm
# once (231µs+14.3ms) by MooseX::Clone::Meta::Attribute::Trait::StrableClone::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/StorableClone.pm
# once (226µs+14.3ms) by Moose::Meta::Method::Accessor::Native::Hash::kv::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/kv.pm
# once (226µs+14.3ms) by Moose::Meta::Method::Accessor::Native::Reader::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Reader.pm
# once (234µs+14.2ms) by Moose::Meta::Method::Accessor::Native::Hash::defined::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/defined.pm
# once (240µs+14.2ms) by MooseX::Clone::Meta::Attribute::Trait::Clone::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm
# once (229µs+14.2ms) by MooseX::Clone::Meta::Attribute::Trait::Clone::Base::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/Clone/Base.pm
# once (229µs+14.2ms) by MooseX::Clone::Meta::Attribute::Trait::Clone::Std::BEGIN@2 at line 2 of MooseX/Clone/Meta/Attribute/Trait/Clone/Std.pm
# once (227µs+14.0ms) by Moose::Meta::Method::Accessor::Native::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor/Native.pm
# once (203µs+10.8ms) by KiokuDB::LiveObjects::BEGIN@16 at line 16 of KiokuDB/LiveObjects.pm
# once (316µs+10.3ms) by Moose::BEGIN@35 at line 35 of Moose.pm
# once (207µs+10.4ms) by Moose::Meta::Attribute::Native::Trait::BEGIN@6 at line 6 of Moose/Meta/Attribute/Native/Trait.pm
# once (199µs+10.3ms) by KiokuDB::Entry::BEGIN@6 at line 6 of KiokuDB/Entry.pm
# once (199µs+10.3ms) by KiokuDB::Backend::BEGIN@6 at line 6 of KiokuDB/Backend.pm
# once (196µs+7.83ms) by Moose::Role::BEGIN@19 at line 19 of Moose/Role.pm | ||||
| 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. | ||||
| 388 | 2482 | 22.8ms | my $traits; | ||
| 389 | 100 | 6.34ms | ( $traits, @_ ) = _strip_traits(@_); # spent 6.34ms making 100 calls to Moose::Exporter::_strip_traits, avg 63µs/call | ||
| 390 | |||||
| 391 | my $metaclass; | ||||
| 392 | 100 | 4.43ms | ( $metaclass, @_ ) = _strip_metaclass(@_); # spent 4.43ms making 100 calls to Moose::Exporter::_strip_metaclass, avg 44µs/call | ||
| 393 | $metaclass | ||||
| 394 | = Moose::Util::resolve_metaclass_alias( 'Class' => $metaclass ) | ||||
| 395 | if defined $metaclass && length $metaclass; | ||||
| 396 | |||||
| 397 | my $meta_name; | ||||
| 398 | 100 | 4.37ms | ( $meta_name, @_ ) = _strip_meta_name(@_); # spent 4.37ms making 100 calls to Moose::Exporter::_strip_meta_name, avg 44µ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). | ||||
| 403 | my $class = $exporting_package; | ||||
| 404 | |||||
| 405 | 100 | 1.60ms | $CALLER = _get_caller(@_); # spent 1.60ms making 100 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 | |||||
| 413 | 100 | 1.49ms | strict->import; # spent 1.49ms making 100 calls to strict::import, avg 15µs/call | ||
| 414 | 100 | 6.70ms | warnings->import; # spent 6.70ms making 100 calls to warnings::import, avg 67µs/call | ||
| 415 | |||||
| 416 | my $did_init_meta; | ||||
| 417 | 100 | 1.20ms | for my $c ( grep { $_->can('init_meta') } $class, @{$exports_from} ) { # spent 1.20ms making 100 calls to UNIVERSAL::can, avg 12µ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. | ||||
| 422 | local $CALLER = $CALLER; | ||||
| 423 | 94 | 723ms | $c->init_meta( # spent 364ms making 69 calls to Moose::Role::init_meta, avg 5.27ms/call
# spent 359ms making 25 calls to Moose::init_meta, avg 14.4ms/call | ||
| 424 | for_class => $CALLER, | ||||
| 425 | metaclass => $metaclass, | ||||
| 426 | meta_name => $meta_name, | ||||
| 427 | ); | ||||
| 428 | $did_init_meta = 1; | ||||
| 429 | } | ||||
| 430 | |||||
| 431 | 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 | |||||
| 446 | my ( undef, @args ) = @_; | ||||
| 447 | my $extra = shift @args if ref $args[0] eq 'HASH'; | ||||
| 448 | |||||
| 449 | $extra ||= {}; | ||||
| 450 | if ( !$extra->{into} ) { | ||||
| 451 | $extra->{into_level} ||= 0; | ||||
| 452 | $extra->{into_level}++; | ||||
| 453 | } | ||||
| 454 | |||||
| 455 | 100 | 953ms | $class->$exporter( $extra, @args ); # spent 953ms making 100 calls to Sub::Exporter::__ANON__[Sub/Exporter.pm:756], avg 9.53ms/call | ||
| 456 | }; | ||||
| 457 | } | ||||
| 458 | |||||
| 459 | # spent 6.34ms (4.45+1.89) within Moose::Exporter::_strip_traits which was called 100 times, avg 63µs/call:
# 100 times (4.45ms+1.89ms) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:456] at line 389, avg 63µs/call | ||||
| 460 | 300 | 6.73ms | 100 | 1.89ms | my $idx = first_index { ( $_ || '' ) eq '-traits' } @_; # spent 1.89ms making 100 calls to List::MoreUtils::firstidx, avg 19µs/call |
| 461 | |||||
| 462 | 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 4.43ms (3.28+1.16) within Moose::Exporter::_strip_metaclass which was called 100 times, avg 44µs/call:
# 100 times (3.28ms+1.16ms) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:456] at line 392, avg 44µs/call | ||||
| 474 | 300 | 4.74ms | 100 | 1.16ms | my $idx = first_index { ( $_ || '' ) eq '-metaclass' } @_; # spent 1.16ms making 100 calls to List::MoreUtils::firstidx, avg 12µs/call |
| 475 | |||||
| 476 | 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 4.37ms (3.24+1.13) within Moose::Exporter::_strip_meta_name which was called 100 times, avg 44µs/call:
# 100 times (3.24ms+1.13ms) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:456] at line 398, avg 44µs/call | ||||
| 486 | 300 | 4.72ms | 100 | 1.13ms | my $idx = first_index { ( $_ || '' ) eq '-meta_name' } @_; # spent 1.13ms making 100 calls to List::MoreUtils::firstidx, avg 11µs/call |
| 487 | |||||
| 488 | 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 | |||||
| 497 | sub _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.60ms within Moose::Exporter::_get_caller which was called 100 times, avg 16µs/call:
# 100 times (1.60ms+0s) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:456] at line 405, avg 16µs/call | ||||
| 530 | |||||
| 531 | # 1 extra level because it's called by import so there's a layer | ||||
| 532 | # of indirection | ||||
| 533 | 200 | 2.11ms | my $offset = 1; | ||
| 534 | |||||
| 535 | return | ||||
| 536 | ( 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 86µs within Moose::Exporter::_make_unimport_sub which was called 3 times, avg 29µs/call:
# 3 times (86µs+0s) by Moose::Exporter::build_import_methods at line 63, avg 29µs/call | ||||
| 543 | 18 | 95µs | shift; | ||
| 544 | my $exporting_package = shift; | ||||
| 545 | my $exports = shift; | ||||
| 546 | my $export_recorder = shift; | ||||
| 547 | my $is_reexport = shift; | ||||
| 548 | |||||
| 549 | # spent 36.0ms (2.31+33.7) within Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:557] which was called 48 times, avg 749µs/call:
# once (71µs+1.17ms) by Moose::Meta::Method::Accessor::Native::Array::first::BEGIN@44 at line 44 of Moose/Meta/Method/Accessor/Native/Array/first.pm
# once (60µs+963µs) by Moose::Meta::Method::Accessor::Native::Array::grep::BEGIN@43 at line 43 of Moose/Meta/Method/Accessor/Native/Array/grep.pm
# once (46µs+809µs) by Moose::Meta::Method::Accessor::Native::Array::splice::BEGIN@60 at line 60 of Moose/Meta/Method/Accessor/Native/Array/splice.pm
# once (46µs+769µs) by Moose::Meta::Method::Accessor::Native::Hash::elements::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash/elements.pm
# once (45µs+760µs) by Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@100 at line 100 of Moose/Meta/Method/Accessor/Native/Hash/set.pm
# once (61µs+741µs) by Moose::Meta::Method::Accessor::Native::Array::insert::BEGIN@64 at line 64 of Moose/Meta/Method/Accessor/Native/Array/insert.pm
# once (45µs+750µs) by Moose::Meta::Method::Accessor::Native::Array::unshift::BEGIN@41 at line 41 of Moose/Meta/Method/Accessor/Native/Array/unshift.pm
# once (61µs+723µs) by Moose::Meta::Method::Accessor::Native::Array::is_empty::BEGIN@24 at line 24 of Moose/Meta/Method/Accessor/Native/Array/is_empty.pm
# once (45µs+725µs) by Moose::Meta::Method::Accessor::Native::Array::uniq::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Array/uniq.pm
# once (46µs+722µs) by Moose::Meta::Method::Accessor::Native::Array::push::BEGIN@41 at line 41 of Moose/Meta/Method/Accessor/Native/Array/push.pm
# once (55µs+708µs) by Moose::Meta::Method::Accessor::Native::Array::set::BEGIN@71 at line 71 of Moose/Meta/Method/Accessor/Native/Array/set.pm
# once (46µs+718µs) by Moose::Meta::Method::Accessor::Native::Array::clear::BEGIN@36 at line 36 of Moose/Meta/Method/Accessor/Native/Array/clear.pm
# once (46µs+714µs) by Moose::Meta::Method::Accessor::Native::Array::pop::BEGIN@49 at line 49 of Moose/Meta/Method/Accessor/Native/Array/pop.pm
# once (46µs+706µs) by Moose::Meta::Method::Accessor::Native::Hash::defined::BEGIN@42 at line 42 of Moose/Meta/Method/Accessor/Native/Hash/defined.pm
# once (61µs+691µs) by Moose::Meta::Method::Accessor::Native::Hash::accessor::BEGIN@80 at line 80 of Moose/Meta/Method/Accessor/Native/Hash/accessor.pm
# once (76µs+671µs) by Moose::Meta::Method::Accessor::Native::Hash::kv::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash/kv.pm
# once (45µs+701µs) by Moose::Meta::Method::Accessor::Native::Array::accessor::BEGIN@77 at line 77 of Moose/Meta/Method/Accessor/Native/Array/accessor.pm
# once (46µs+700µs) by Moose::Meta::Method::Accessor::Native::Array::sort_in_place::BEGIN@45 at line 45 of Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm
# once (45µs+697µs) by Moose::Meta::Method::Accessor::Native::Array::natatime::BEGIN@57 at line 57 of Moose/Meta/Method/Accessor/Native/Array/natatime.pm
# once (46µs+693µs) by Moose::Meta::Method::Accessor::Native::Array::delete::BEGIN@55 at line 55 of Moose/Meta/Method/Accessor/Native/Array/delete.pm
# once (46µs+693µs) by Moose::Meta::Method::Accessor::Native::Array::shift::BEGIN@51 at line 51 of Moose/Meta/Method/Accessor/Native/Array/shift.pm
# once (45µs+693µs) by Moose::Meta::Method::Accessor::Native::Hash::values::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash/values.pm
# once (46µs+691µs) by Moose::Meta::Method::Accessor::Native::Array::count::BEGIN@23 at line 23 of Moose/Meta/Method/Accessor/Native/Array/count.pm
# once (45µs+692µs) by Moose::Meta::Method::Accessor::Native::Array::sort::BEGIN@41 at line 41 of Moose/Meta/Method/Accessor/Native/Array/sort.pm
# once (46µs+690µs) by Moose::Meta::Method::Accessor::Native::Array::reduce::BEGIN@44 at line 44 of Moose/Meta/Method/Accessor/Native/Array/reduce.pm
# once (43µs+688µs) by Moose::Meta::Method::Accessor::Native::Array::shuffle::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Array/shuffle.pm
# once (43µs+687µs) by Moose::Meta::Method::Accessor::Native::Array::map::BEGIN@43 at line 43 of Moose/Meta/Method/Accessor/Native/Array/map.pm
# once (43µs+687µs) by Moose::Meta::Method::Accessor::Native::Array::elements::BEGIN@24 at line 24 of Moose/Meta/Method/Accessor/Native/Array/elements.pm
# once (44µs+685µs) by Moose::Meta::Method::Accessor::Native::Array::BEGIN@23 at line 23 of Moose/Meta/Method/Accessor/Native/Array.pm
# once (43µs+683µs) by Moose::Meta::Method::Accessor::Native::Array::join::BEGIN@43 at line 43 of Moose/Meta/Method/Accessor/Native/Array/join.pm
# once (44µs+680µs) by Moose::Meta::Method::Accessor::Native::Hash::clear::BEGIN@36 at line 36 of Moose/Meta/Method/Accessor/Native/Hash/clear.pm
# once (58µs+665µs) by Moose::Meta::Method::Accessor::Native::Hash::Writer::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash/Writer.pm
# once (45µs+677µs) by Moose::Meta::Method::Accessor::Native::Hash::is_empty::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm
# once (53µs+669µs) by Moose::Meta::Method::Accessor::Native::Collection::BEGIN@147 at line 147 of Moose/Meta/Method/Accessor/Native/Collection.pm
# once (45µs+676µs) by Moose::Meta::Method::Accessor::Native::Hash::delete::BEGIN@41 at line 41 of Moose/Meta/Method/Accessor/Native/Hash/delete.pm
# once (44µs+676µs) by Moose::Meta::Method::Accessor::Native::Hash::exists::BEGIN@42 at line 42 of Moose/Meta/Method/Accessor/Native/Hash/exists.pm
# once (43µs+671µs) by Moose::Meta::Method::Accessor::Native::Hash::get::BEGIN@41 at line 41 of Moose/Meta/Method/Accessor/Native/Hash/get.pm
# once (45µs+667µs) by Moose::Meta::Method::Accessor::Native::Hash::keys::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash/keys.pm
# once (45µs+666µs) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@27 at line 27 of Moose/Meta/Attribute/Native/Trait/Hash.pm
# once (43µs+661µs) by Moose::Meta::Method::Accessor::Native::Hash::count::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash/count.pm
# once (46µs+653µs) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@38 at line 38 of Moose/Meta/Attribute/Native/Trait/Array.pm
# once (43µs+648µs) by Moose::Meta::Method::Accessor::Native::Hash::BEGIN@21 at line 21 of Moose/Meta/Method/Accessor/Native/Hash.pm
# once (48µs+638µs) by Moose::Meta::Method::Accessor::Native::Writer::BEGIN@187 at line 187 of Moose/Meta/Method/Accessor/Native/Writer.pm
# once (44µs+642µs) by Moose::Meta::Method::Accessor::Native::Reader::BEGIN@63 at line 63 of Moose/Meta/Method/Accessor/Native/Reader.pm
# once (44µs+620µs) by Moose::Meta::Method::Accessor::Native::BEGIN@144 at line 144 of Moose/Meta/Method/Accessor/Native.pm
# once (45µs+616µs) by Moose::Meta::Attribute::Native::Trait::BEGIN@198 at line 198 of Moose/Meta/Attribute/Native/Trait.pm
# once (47µs+605µs) by Moose::Meta::Attribute::Native::Trait::BEGIN@197 at line 197 of Moose/Meta/Attribute/Native/Trait.pm
# once (46µs+505µs) by Throwable::BEGIN@31 at line 31 of Throwable.pm | ||||
| 550 | 96 | 2.38ms | my $caller = scalar caller(); | ||
| 551 | Moose::Exporter->_remove_keywords( | ||||
| 552 | $caller, | ||||
| 553 | 48 | 33.7ms | [ keys %{$exports} ], # spent 33.7ms making 48 calls to Moose::Exporter::_remove_keywords, avg 701µs/call | ||
| 554 | $export_recorder, | ||||
| 555 | $is_reexport, | ||||
| 556 | ); | ||||
| 557 | }; | ||||
| 558 | } | ||||
| 559 | |||||
| 560 | # spent 33.7ms (33.0+621µs) within Moose::Exporter::_remove_keywords which was called 48 times, avg 701µs/call:
# 48 times (33.0ms+621µs) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:557] at line 553, avg 701µs/call | ||||
| 561 | 3755 | 34.0ms | shift; | ||
| 562 | my $package = shift; | ||||
| 563 | my $keywords = shift; | ||||
| 564 | my $recorded_exports = shift; | ||||
| 565 | my $is_reexport = shift; | ||||
| 566 | |||||
| 567 | 3 | 276µs | 2 | 195µs | # spent 119µs (43+76) within Moose::Exporter::BEGIN@567 which was called:
# once (43µs+76µs) by Moose::BEGIN@15 at line 567 # spent 119µs making 1 call to Moose::Exporter::BEGIN@567
# spent 76µs making 1 call to strict::unimport |
| 568 | |||||
| 569 | foreach my $name ( @{$keywords} ) { | ||||
| 570 | if ( defined &{ $package . '::' . $name } ) { | ||||
| 571 | my $sub = \&{ $package . '::' . $name }; | ||||
| 572 | |||||
| 573 | # make sure it is from us | ||||
| 574 | next unless $recorded_exports->{$sub}; | ||||
| 575 | |||||
| 576 | if ( $is_reexport->{$name} ) { | ||||
| 577 | 3 | 1.26ms | 2 | 159µs | # spent 99µs (38+61) within Moose::Exporter::BEGIN@577 which was called:
# once (38µs+61µs) by Moose::BEGIN@15 at line 577 # spent 99µs making 1 call to Moose::Exporter::BEGIN@577
# spent 60µs making 1 call to strict::unimport |
| 578 | next | ||||
| 579 | unless _export_is_flagged( | ||||
| 580 | 94 | 621µs | \*{ join q{::} => $package, $name } ); # spent 621µs making 94 calls to Moose::Exporter::_export_is_flagged, avg 7µs/call | ||
| 581 | } | ||||
| 582 | |||||
| 583 | # and if it is from us, then undef the slot | ||||
| 584 | delete ${ $package . '::' }{$name}; | ||||
| 585 | } | ||||
| 586 | } | ||||
| 587 | } | ||||
| 588 | |||||
| 589 | # spent 269µs within Moose::Exporter::_make_init_meta which was called 3 times, avg 90µs/call:
# 3 times (269µs+0s) by Moose::Exporter::build_import_methods at line 70, avg 90µs/call | ||||
| 590 | 51 | 273µs | shift; | ||
| 591 | my $class = shift; | ||||
| 592 | my $args = shift; | ||||
| 593 | |||||
| 594 | my %old_style_roles; | ||||
| 595 | 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 | ) { | ||||
| 608 | $old_style_roles{$role} = $args->{$role} | ||||
| 609 | if exists $args->{$role}; | ||||
| 610 | } | ||||
| 611 | |||||
| 612 | my %base_class_roles; | ||||
| 613 | %base_class_roles = ( roles => $args->{base_class_roles} ) | ||||
| 614 | if exists $args->{base_class_roles}; | ||||
| 615 | |||||
| 616 | my %new_style_roles = map { $_ => $args->{$_} } | ||||
| 617 | grep { exists $args->{$_} } qw( class_metaroles role_metaroles ); | ||||
| 618 | |||||
| 619 | 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 393µs (133+259) within Moose::Exporter::import which was called 3 times, avg 131µs/call:
# once (50µs+91µs) by Moose::BEGIN@15 at line 15 of Moose.pm
# once (41µs+89µs) by Moose::Role::BEGIN@17 at line 17 of Moose/Role.pm
# once (42µs+79µs) by Moose::Util::TypeConstraints::BEGIN@7 at line 7 of Moose/Util/TypeConstraints.pm | ||||
| 647 | 6 | 110µs | 3 | 43µs | strict->import; # spent 43µs making 3 calls to strict::import, avg 14µs/call |
| 648 | 3 | 216µs | warnings->import; # spent 216µs making 3 calls to warnings::import, avg 72µs/call | ||
| 649 | } | ||||
| 650 | |||||
| 651 | 1 | 25µs | 1; | ||
| 652 | |||||
| 653 | __END__ | ||||
# spent 621µs within Moose::Exporter::_export_is_flagged which was called 94 times, avg 7µs/call:
# 94 times (621µs+0s) by Moose::Exporter::_remove_keywords at line 580, avg 7µs/call | |||||
# spent 1.36ms within Moose::Exporter::_flag_as_reexport which was called 186 times, avg 7µs/call:
# 186 times (1.36ms+0s) by Moose::Exporter::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Exporter.pm:125] at line 123, avg 7µs/call |