| Filename | /home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm |
| Statements | Executed 26049 statements in 259ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 137 | 1 | 1 | 53.2ms | 414ms | Moose::Exporter::__ANON__[:125] |
| 664 | 1 | 1 | 35.8ms | 69.2ms | Moose::Exporter::__ANON__[:329] |
| 137 | 135 | 88 | 31.5ms | 2.64s | Moose::Exporter::__ANON__[:456] |
| 664 | 1 | 1 | 24.6ms | 24.6ms | Moose::Exporter::_late_curry_wrapper |
| 34 | 1 | 1 | 22.5ms | 22.9ms | Moose::Exporter::_remove_keywords |
| 42 | 1 | 1 | 5.44ms | 925ms | Moose::Exporter::__ANON__[:643] |
| 137 | 1 | 1 | 5.39ms | 7.84ms | Moose::Exporter::_strip_traits |
| 534 | 1 | 1 | 4.48ms | 4.48ms | Moose::Exporter::__ANON__[:259] |
| 137 | 1 | 1 | 4.25ms | 5.78ms | Moose::Exporter::_strip_meta_name |
| 137 | 1 | 1 | 4.23ms | 5.78ms | Moose::Exporter::_strip_metaclass |
| 7 | 1 | 1 | 3.62ms | 6.93ms | Moose::Exporter::_make_sub_exporter_params |
| 167 | 1 | 1 | 3.58ms | 9.87ms | Moose::Exporter::__ANON__[:321] |
| 1 | 1 | 1 | 3.46ms | 4.44ms | Moose::Exporter::BEGIN@13 |
| 50 | 1 | 1 | 2.26ms | 4.64ms | Moose::Exporter::__ANON__[:307] |
| 7 | 1 | 1 | 2.11ms | 30.0ms | Moose::Exporter::build_import_methods |
| 137 | 1 | 1 | 2.06ms | 2.06ms | Moose::Exporter::_get_caller |
| 66 | 3 | 1 | 1.90ms | 1.90ms | Moose::Exporter::_sub_from_package |
| 50 | 1 | 1 | 1.64ms | 1.67ms | Moose::Exporter::_curry_wrapper |
| 34 | 34 | 33 | 1.60ms | 24.5ms | Moose::Exporter::__ANON__[:557] |
| 163 | 1 | 1 | 1.13ms | 1.13ms | Moose::Exporter::_flag_as_reexport (xsub) |
| 7 | 1 | 1 | 747µs | 747µs | Moose::Exporter::_make_init_meta |
| 25 | 1 | 1 | 681µs | 681µs | Moose::Exporter::_make_wrapped_sub |
| 16 | 1 | 1 | 480µs | 480µs | Moose::Exporter::_make_wrapped_sub_with_meta |
| 66 | 1 | 1 | 423µs | 423µs | Moose::Exporter::_export_is_flagged (xsub) |
| 7 | 1 | 1 | 391µs | 15.0ms | Moose::Exporter::_make_exporter |
| 7 | 7 | 7 | 388µs | 30.4ms | Moose::Exporter::setup_import_methods |
| 7 | 1 | 1 | 384µs | 616µs | Moose::Exporter::_follow_also |
| 7 | 7 | 7 | 365µs | 970µs | Moose::Exporter::import |
| 7 | 1 | 1 | 297µs | 297µs | Moose::Exporter::_make_import_sub |
| 7 | 1 | 1 | 212µs | 212µs | Moose::Exporter::_make_unimport_sub |
| 7 | 1 | 1 | 200µs | 200µs | Moose::Exporter::_parse_trait_aliases |
| 7 | 1 | 1 | 143µs | 143µs | Moose::Exporter::_follow_also_real |
| 1 | 1 | 1 | 74µs | 755µs | Moose::Exporter::BEGIN@15 |
| 1 | 1 | 1 | 63µs | 80µs | Moose::Exporter::BEGIN@3 |
| 1 | 1 | 1 | 53µs | 146µs | Moose::Exporter::BEGIN@567 |
| 1 | 1 | 1 | 45µs | 120µs | Moose::Exporter::BEGIN@120 |
| 1 | 1 | 1 | 44µs | 118µs | Moose::Exporter::BEGIN@272 |
| 1 | 1 | 1 | 43µs | 208µs | Moose::Exporter::BEGIN@14 |
| 1 | 1 | 1 | 41µs | 204µs | Moose::Exporter::BEGIN@16 |
| 1 | 1 | 1 | 40µs | 40µs | Moose::Exporter::BEGIN@11 |
| 1 | 1 | 1 | 40µs | 227µs | Moose::Exporter::BEGIN@12 |
| 1 | 1 | 1 | 40µs | 100µs | Moose::Exporter::BEGIN@577 |
| 1 | 1 | 1 | 39µs | 105µs | Moose::Exporter::BEGIN@4 |
| 1 | 1 | 1 | 39µs | 104µs | Moose::Exporter::BEGIN@121 |
| 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__[: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::_apply_meta_traits |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Exporter; | ||||
| 2 | |||||
| 3 | 3 | 97µs | 2 | 96µs | # spent 80µs (63+17) within Moose::Exporter::BEGIN@3 which was called:
# once (63µs+17µs) by Moose::BEGIN@15 at line 3 # spent 80µs making 1 call to Moose::Exporter::BEGIN@3
# spent 17µs making 1 call to strict::import |
| 4 | 3 | 230µs | 2 | 170µs | # spent 105µs (39+66) within Moose::Exporter::BEGIN@4 which was called:
# once (39µs+66µs) by Moose::BEGIN@15 at line 4 # spent 105µs making 1 call to Moose::Exporter::BEGIN@4
# spent 66µs making 1 call to warnings::import |
| 5 | |||||
| 6 | 1 | 5µs | our $VERSION = '1.19'; | ||
| 7 | 1 | 2µs | our $XS_VERSION = $VERSION; | ||
| 8 | 1 | 69µs | $VERSION = eval $VERSION; # spent 11µs executing statements in string eval | ||
| 9 | 1 | 3µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 10 | |||||
| 11 | 3 | 122µs | 1 | 40µs | # spent 40µs within Moose::Exporter::BEGIN@11 which was called:
# once (40µs+0s) by Moose::BEGIN@15 at line 11 # spent 40µs making 1 call to Moose::Exporter::BEGIN@11 |
| 12 | 3 | 101µs | 2 | 414µs | # spent 227µs (40+187) within Moose::Exporter::BEGIN@12 which was called:
# once (40µs+187µs) by Moose::BEGIN@15 at line 12 # spent 227µs making 1 call to Moose::Exporter::BEGIN@12
# spent 187µs making 1 call to Exporter::import |
| 13 | 3 | 544µs | 1 | 4.44ms | # spent 4.44ms (3.46+986µs) within Moose::Exporter::BEGIN@13 which was called:
# once (3.46ms+986µs) by Moose::BEGIN@15 at line 13 # spent 4.44ms making 1 call to Moose::Exporter::BEGIN@13 |
| 14 | 3 | 109µs | 2 | 373µs | # spent 208µs (43+165) within Moose::Exporter::BEGIN@14 which was called:
# once (43µs+165µs) by Moose::BEGIN@15 at line 14 # spent 208µs making 1 call to Moose::Exporter::BEGIN@14
# spent 165µs making 1 call to Exporter::import |
| 15 | 3 | 260µs | 3 | 1.44ms | # spent 755µs (74+681) within Moose::Exporter::BEGIN@15 which was called:
# once (74µs+681µs) by Moose::BEGIN@15 at line 15 # spent 755µs making 1 call to Moose::Exporter::BEGIN@15
# spent 624µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
# spent 57µs making 1 call to UNIVERSAL::VERSION |
| 16 | 3 | 106µs | 2 | 368µs | # spent 204µs (41+163) within Moose::Exporter::BEGIN@16 which was called:
# once (41µs+163µs) by Moose::BEGIN@15 at line 16 # spent 204µs making 1 call to Moose::Exporter::BEGIN@16
# spent 163µs making 1 call to Exporter::import |
| 17 | |||||
| 18 | 3 | 1.54ms | 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 | 234µs | 1 | 203µs | XSLoader::load( 'Moose', $XS_VERSION ); # spent 203µs making 1 call to XSLoader::load |
| 21 | |||||
| 22 | 1 | 2µs | my %EXPORT_SPEC; | ||
| 23 | |||||
| 24 | # spent 30.4ms (388µs+30.0) within Moose::Exporter::setup_import_methods which was called 7 times, avg 4.35ms/call:
# once (61µs+7.14ms) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 88 of Moose/Role.pm
# once (56µs+5.42ms) by Markdent::Role::Event::BEGIN@10 at line 13 of MooseX/Role/Parameterized.pm
# once (60µs+5.31ms) by Moose::Meta::Attribute::BEGIN@20 at line 42 of Moose/Util/TypeConstraints.pm
# once (56µs+4.29ms) by MooseX::Types::BEGIN@2 at line 122 of Moose.pm
# once (51µs+4.01ms) by MooseX::Types::BEGIN@15 at line 68 of MooseX/Types/CheckedUtilExports.pm
# once (53µs+1.98ms) by Markdent::Event::StartDocument::BEGIN@11 at line 15 of MooseX/StrictConstructor.pm
# once (50µs+1.88ms) by Markdent::Handler::HTMLStream::Document::BEGIN@13 at line 14 of MooseX/SemiAffordanceAccessor.pm | ||||
| 25 | 21 | 400µs | my ( $class, %args ) = @_; | ||
| 26 | |||||
| 27 | my $exporting_package = $args{exporting_package} ||= caller(); | ||||
| 28 | |||||
| 29 | 7 | 30.0ms | $class->build_import_methods( # spent 30.0ms making 7 calls to Moose::Exporter::build_import_methods, avg 4.29ms/call | ||
| 30 | %args, | ||||
| 31 | install => [qw(import unimport init_meta)] | ||||
| 32 | ); | ||||
| 33 | } | ||||
| 34 | |||||
| 35 | # spent 30.0ms (2.11+27.9) within Moose::Exporter::build_import_methods which was called 7 times, avg 4.29ms/call:
# 7 times (2.11ms+27.9ms) by Moose::Exporter::setup_import_methods at line 29, avg 4.29ms/call | ||||
| 36 | 163 | 1.92ms | my ( $class, %args ) = @_; | ||
| 37 | |||||
| 38 | my $exporting_package = $args{exporting_package} ||= caller(); | ||||
| 39 | |||||
| 40 | $EXPORT_SPEC{$exporting_package} = \%args; | ||||
| 41 | |||||
| 42 | 7 | 616µs | my @exports_from = $class->_follow_also($exporting_package); # spent 616µs making 7 calls to Moose::Exporter::_follow_also, avg 88µs/call | ||
| 43 | |||||
| 44 | my $export_recorder = {}; | ||||
| 45 | my $is_reexport = {}; | ||||
| 46 | |||||
| 47 | 7 | 6.93ms | my $exports = $class->_make_sub_exporter_params( # spent 6.93ms making 7 calls to Moose::Exporter::_make_sub_exporter_params, avg 989µs/call | ||
| 48 | [ @exports_from, $exporting_package ], | ||||
| 49 | $export_recorder, | ||||
| 50 | $is_reexport, | ||||
| 51 | ); | ||||
| 52 | |||||
| 53 | 7 | 15.0ms | my $exporter = $class->_make_exporter($exports, $is_reexport); # spent 15.0ms making 7 calls to Moose::Exporter::_make_exporter, avg 2.14ms/call | ||
| 54 | |||||
| 55 | my %methods; | ||||
| 56 | 7 | 297µs | $methods{import} = $class->_make_import_sub( # spent 297µs making 7 calls to Moose::Exporter::_make_import_sub, avg 42µs/call | ||
| 57 | $exporting_package, | ||||
| 58 | $exporter, | ||||
| 59 | \@exports_from, | ||||
| 60 | $is_reexport | ||||
| 61 | ); | ||||
| 62 | |||||
| 63 | 7 | 212µs | $methods{unimport} = $class->_make_unimport_sub( # spent 212µs making 7 calls to Moose::Exporter::_make_unimport_sub, avg 30µs/call | ||
| 64 | $exporting_package, | ||||
| 65 | $exports, | ||||
| 66 | $export_recorder, | ||||
| 67 | $is_reexport | ||||
| 68 | ); | ||||
| 69 | |||||
| 70 | 7 | 747µs | $methods{init_meta} = $class->_make_init_meta( # spent 747µs making 7 calls to Moose::Exporter::_make_init_meta, avg 107µs/call | ||
| 71 | $exporting_package, | ||||
| 72 | \%args | ||||
| 73 | ); | ||||
| 74 | |||||
| 75 | 7 | 1.29ms | my $package = Class::MOP::Package->initialize($exporting_package); # spent 1.29ms making 7 calls to Class::MOP::Package::initialize, avg 184µs/call | ||
| 76 | for my $to_install ( @{ $args{install} || [] } ) { | ||||
| 77 | my $symbol = '&' . $to_install; | ||||
| 78 | next | ||||
| 79 | 16 | 1.45ms | unless $methods{$to_install} # spent 1.45ms making 16 calls to Class::MOP::Package::has_package_symbol, avg 91µs/call | ||
| 80 | && !$package->has_package_symbol($symbol); | ||||
| 81 | 16 | 1.43ms | $package->add_package_symbol( $symbol, $methods{$to_install} ); # spent 1.43ms making 16 calls to Class::MOP::Package::add_package_symbol, avg 89µs/call | ||
| 82 | } | ||||
| 83 | |||||
| 84 | return ( $methods{import}, $methods{unimport}, $methods{init_meta} ); | ||||
| 85 | } | ||||
| 86 | |||||
| 87 | # spent 15.0ms (391µs+14.6) within Moose::Exporter::_make_exporter which was called 7 times, avg 2.14ms/call:
# 7 times (391µs+14.6ms) by Moose::Exporter::build_import_methods at line 53, avg 2.14ms/call | ||||
| 88 | 14 | 394µs | my ($class, $exports, $is_reexport) = @_; | ||
| 89 | |||||
| 90 | return Sub::Exporter::build_exporter( | ||||
| 91 | { | ||||
| 92 | exports => $exports, | ||||
| 93 | groups => { default => [':all'] }, | ||||
| 94 | # spent 414ms (53.2+361) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:125] which was called 137 times, avg 3.02ms/call:
# 137 times (53.2ms+361ms) by Sub::Exporter::_do_import at line 799 of Sub/Exporter.pm, avg 3.02ms/call | ||||
| 95 | 6142 | 52.0ms | my ($arg, $to_export) = @_; | ||
| 96 | 137 | 5.03ms | my $meta = Class::MOP::class_of($arg->{into}); # spent 5.03ms making 137 calls to Class::MOP::class_of, avg 37µs/call | ||
| 97 | |||||
| 98 | 7 | 22.9ms | goto &Sub::Exporter::default_installer unless $meta; # spent 22.9ms making 7 calls to Sub::Exporter::default_installer, avg 3.27ms/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 | 1160 | 71.3ms | next if !ref($as) # spent 71.1ms making 1157 calls to Class::MOP::Package::has_package_symbol, avg 61µs/call
# spent 179µs making 3 calls to Class::MOP::Package::get_package_symbol, avg 60µ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 | 130 | 283ms | Sub::Exporter::default_installer($arg, \@filtered_to_export); # spent 283ms making 130 calls to Sub::Exporter::default_installer, avg 2.18ms/call | ||
| 118 | |||||
| 119 | for my $name ( keys %{$is_reexport} ) { | ||||
| 120 | 3 | 108µs | 2 | 196µs | # spent 120µs (45+75) within Moose::Exporter::BEGIN@120 which was called:
# once (45µs+75µs) by Moose::BEGIN@15 at line 120 # spent 120µs making 1 call to Moose::Exporter::BEGIN@120
# spent 75µs making 1 call to strict::unimport |
| 121 | 3 | 2.51ms | 2 | 170µs | # spent 104µs (39+66) within Moose::Exporter::BEGIN@121 which was called:
# once (39µs+66µs) by Moose::BEGIN@15 at line 121 # spent 104µs making 1 call to Moose::Exporter::BEGIN@121
# spent 66µs making 1 call to warnings::unimport |
| 122 | next unless exists $installed{$name}; | ||||
| 123 | 163 | 1.13ms | _flag_as_reexport( \*{ join q{::}, $arg->{into}, $name } ); # spent 1.13ms making 163 calls to Moose::Exporter::_flag_as_reexport, avg 7µs/call | ||
| 124 | } | ||||
| 125 | }, | ||||
| 126 | } | ||||
| 127 | 7 | 14.6ms | ); # spent 14.6ms making 7 calls to Sub::Exporter::build_exporter, avg 2.08ms/call | ||
| 128 | } | ||||
| 129 | |||||
| 130 | { | ||||
| 131 | 2 | 9µs | my $seen = {}; | ||
| 132 | |||||
| 133 | # spent 616µs (384+232) within Moose::Exporter::_follow_also which was called 7 times, avg 88µs/call:
# 7 times (384µs+232µs) by Moose::Exporter::build_import_methods at line 42, avg 88µs/call | ||||
| 134 | 28 | 405µs | my $class = shift; | ||
| 135 | my $exporting_package = shift; | ||||
| 136 | |||||
| 137 | local %$seen = ( $exporting_package => 1 ); | ||||
| 138 | |||||
| 139 | 14 | 232µs | return uniq( _follow_also_real($exporting_package) ); # spent 143µs making 7 calls to Moose::Exporter::_follow_also_real, avg 20µs/call
# spent 89µs making 7 calls to List::MoreUtils::uniq, avg 13µs/call | ||
| 140 | } | ||||
| 141 | |||||
| 142 | # spent 143µs within Moose::Exporter::_follow_also_real which was called 7 times, avg 20µs/call:
# 7 times (143µs+0s) by Moose::Exporter::_follow_also at line 139, avg 20µs/call | ||||
| 143 | 28 | 229µ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 200µs within Moose::Exporter::_parse_trait_aliases which was called 7 times, avg 29µs/call:
# 7 times (200µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 233, avg 29µs/call | ||||
| 172 | 35 | 239µ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 6.93ms (3.62+3.30) within Moose::Exporter::_make_sub_exporter_params which was called 7 times, avg 989µs/call:
# 7 times (3.62ms+3.30ms) by Moose::Exporter::build_import_methods at line 47, avg 989µs/call | ||||
| 196 | 389 | 3.21ms | 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 | 485µs | my $sub = $class->_sub_from_package( $package, $name ) # spent 485µs making 16 calls to Moose::Exporter::_sub_from_package, avg 30µs/call | ||
| 209 | or next; | ||||
| 210 | |||||
| 211 | my $fq_name = $package . '::' . $name; | ||||
| 212 | |||||
| 213 | 16 | 480µs | $exports{$name} = $class->_make_wrapped_sub_with_meta( # spent 480µs making 16 calls to Moose::Exporter::_make_wrapped_sub_with_meta, avg 30µs/call | ||
| 214 | $fq_name, | ||||
| 215 | $sub, | ||||
| 216 | $export_recorder, | ||||
| 217 | ); | ||||
| 218 | } | ||||
| 219 | |||||
| 220 | for my $name ( @{ $args->{with_caller} } ) { | ||||
| 221 | 25 | 674µs | my $sub = $class->_sub_from_package( $package, $name ) # spent 674µs making 25 calls to Moose::Exporter::_sub_from_package, avg 27µs/call | ||
| 222 | or next; | ||||
| 223 | |||||
| 224 | my $fq_name = $package . '::' . $name; | ||||
| 225 | |||||
| 226 | 25 | 681µs | $exports{$name} = $class->_make_wrapped_sub( # spent 681µs making 25 calls to Moose::Exporter::_make_wrapped_sub, avg 27µs/call | ||
| 227 | $fq_name, | ||||
| 228 | $sub, | ||||
| 229 | $export_recorder, | ||||
| 230 | ); | ||||
| 231 | } | ||||
| 232 | |||||
| 233 | 7 | 200µs | my @extra_exports = $class->_parse_trait_aliases( # spent 200µs making 7 calls to Moose::Exporter::_parse_trait_aliases, avg 29µ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 | 47µs | ( $coderef_pkg, $coderef_name ) # spent 47µs making 4 calls to Class::MOP::get_code_info, avg 12µ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 | 25 | 736µs | $sub = $class->_sub_from_package( $package, $name ) # spent 736µs making 25 calls to Moose::Exporter::_sub_from_package, avg 29µs/call | ||
| 252 | or next; | ||||
| 253 | |||||
| 254 | $coderef_name = $name; | ||||
| 255 | } | ||||
| 256 | |||||
| 257 | $export_recorder->{$sub} = 1; | ||||
| 258 | |||||
| 259 | 534 | 6.23ms | # spent 4.48ms within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:259] which was called 534 times, avg 8µs/call:
# 534 times (4.48ms+0s) by Sub::Exporter::default_generator at line 856 of Sub/Exporter.pm, avg 8µs/call | ||
| 260 | } | ||||
| 261 | } | ||||
| 262 | |||||
| 263 | return \%exports; | ||||
| 264 | } | ||||
| 265 | |||||
| 266 | # spent 1.90ms within Moose::Exporter::_sub_from_package which was called 66 times, avg 29µs/call:
# 25 times (736µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 251, avg 29µs/call
# 25 times (674µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 221, avg 27µs/call
# 16 times (485µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 208, avg 30µs/call | ||||
| 267 | 396 | 2.16ms | my $sclass = shift; | ||
| 268 | my $package = shift; | ||||
| 269 | my $name = shift; | ||||
| 270 | |||||
| 271 | my $sub = do { | ||||
| 272 | 3 | 4.90ms | 2 | 192µs | # spent 118µs (44+74) within Moose::Exporter::BEGIN@272 which was called:
# once (44µs+74µs) by Moose::BEGIN@15 at line 272 # spent 118µ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 | # spent 681µs within Moose::Exporter::_make_wrapped_sub which was called 25 times, avg 27µs/call:
# 25 times (681µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 226, avg 27µs/call | ||||
| 286 | 125 | 770µs | 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 | # spent 4.64ms (2.26+2.38) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:307] which was called 50 times, avg 93µs/call:
# 50 times (2.26ms+2.38ms) by Sub::Exporter::default_generator at line 856 of Sub/Exporter.pm, avg 93µs/call | ||||
| 298 | 250 | 2.84ms | my $caller = $CALLER; | ||
| 299 | |||||
| 300 | 50 | 1.67ms | my $wrapper = $self->_curry_wrapper( $sub, $fq_name, $caller ); # spent 1.67ms making 50 calls to Moose::Exporter::_curry_wrapper, avg 33µs/call | ||
| 301 | |||||
| 302 | 50 | 711µs | my $sub = subname( $fq_name => $wrapper ); # spent 711µs making 50 calls to Sub::Name::subname, avg 14µs/call | ||
| 303 | |||||
| 304 | $export_recorder->{$sub} = 1; | ||||
| 305 | |||||
| 306 | return $sub; | ||||
| 307 | }; | ||||
| 308 | } | ||||
| 309 | |||||
| 310 | # spent 480µs within Moose::Exporter::_make_wrapped_sub_with_meta which was called 16 times, avg 30µs/call:
# 16 times (480µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 213, avg 30µs/call | ||||
| 311 | 80 | 580µs | my $self = shift; | ||
| 312 | my $fq_name = shift; | ||||
| 313 | my $sub = shift; | ||||
| 314 | my $export_recorder = shift; | ||||
| 315 | |||||
| 316 | # spent 69.2ms (35.8+33.5) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:329] which was called 664 times, avg 104µs/call:
# 664 times (35.8ms+33.5ms) by Sub::Exporter::default_generator at line 856 of Sub/Exporter.pm, avg 104µs/call | ||||
| 317 | 3320 | 42.8ms | my $caller = $CALLER; | ||
| 318 | |||||
| 319 | my $wrapper = $self->_late_curry_wrapper( | ||||
| 320 | $sub, $fq_name, | ||||
| 321 | 167 | 3.82ms | 831 | 30.9ms | # spent 9.87ms (3.58+6.29) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:321] which was called 167 times, avg 59µs/call:
# 167 times (3.58ms+6.29ms) 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::around or Moose::extends or Moose::has or Moose::with at line 358, avg 59µs/call # spent 24.6ms making 664 calls to Moose::Exporter::_late_curry_wrapper, avg 37µs/call
# spent 6.29ms making 167 calls to Class::MOP::class_of, avg 38µs/call |
| 322 | ); | ||||
| 323 | |||||
| 324 | 664 | 8.84ms | my $sub = subname( $fq_name => $wrapper ); # spent 8.84ms making 664 calls to Sub::Name::subname, avg 13µs/call | ||
| 325 | |||||
| 326 | $export_recorder->{$sub} = 1; | ||||
| 327 | |||||
| 328 | return $sub; | ||||
| 329 | }; | ||||
| 330 | } | ||||
| 331 | |||||
| 332 | # spent 1.67ms (1.64+34µs) within Moose::Exporter::_curry_wrapper which was called 50 times, avg 33µs/call:
# 50 times (1.64ms+34µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:307] at line 300, avg 33µs/call | ||||
| 333 | 350 | 1.92ms | my $class = shift; | ||
| 334 | my $sub = shift; | ||||
| 335 | my $fq_name = shift; | ||||
| 336 | my @extra = @_; | ||||
| 337 | |||||
| 338 | 232 | 4.53ms | 232 | 181ms | my $wrapper = sub { $sub->( @extra, @_ ) }; # spent 158ms making 212 calls to MooseX::Role::Parameterized::method, avg 746µs/call
# spent 22.3ms making 1 call to MooseX::Role::Parameterized::parameter
# spent 505µs making 17 calls to MooseX::Types::CheckedUtilExports::__ANON__[MooseX/Types/CheckedUtilExports.pm:64], avg 30µs/call
# spent 270µs making 2 calls to MooseX::Role::Parameterized::role, avg 135µs/call |
| 339 | 4 | 34µs | if ( my $proto = prototype $sub ) { # spent 34µs making 4 calls to Scalar::Util::set_prototype, avg 8µs/call | ||
| 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 24.6ms within Moose::Exporter::_late_curry_wrapper which was called 664 times, avg 37µs/call:
# 664 times (24.6ms+0s) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:329] at line 321, avg 37µs/call | ||||
| 349 | 5312 | 27.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 | 334 | 7.42ms | 167 | 9.87ms | my @curry = ( $extra->(@ex_args) ); # spent 9.87ms making 167 calls to Moose::Exporter::__ANON__[Moose/Exporter.pm:321], avg 59µs/call |
| 359 | 167 | 5.70s | return $sub->( @curry, @_ ); # spent 2.58s making 50 calls to Moose::has, avg 51.6ms/call
# spent 2.34s making 53 calls to Moose::with, avg 44.1ms/call, recursion: max depth 1, sum of overlapping time 74.7ms
# spent 1.13s making 26 calls to Moose::Role::with, avg 43.6ms/call, recursion: max depth 2, sum of overlapping time 309ms
# spent 15.2ms making 3 calls to Moose::extends, avg 5.05ms/call
# spent 5.70ms making 9 calls to Moose::Role::has, avg 633µs/call
# spent 3.08ms making 9 calls to Moose::Role::requires, avg 342µs/call
# spent 1.77ms making 8 calls to Moose::Role::around, avg 221µs/call
# spent 1.60ms making 1 call to Moose::around
# spent 762µs making 3 calls to Moose::Role::override, avg 254µs/call
# spent 754µs making 3 calls to Moose::Role::before, avg 251µs/call
# spent 455µs making 2 calls to Moose::Role::after, avg 228µs/call | ||
| 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 297µs within Moose::Exporter::_make_import_sub which was called 7 times, avg 42µs/call:
# 7 times (297µs+0s) by Moose::Exporter::build_import_methods at line 56, avg 42µs/call | ||||
| 372 | 42 | 318µs | shift; | ||
| 373 | my $exporting_package = shift; | ||||
| 374 | my $exporter = shift; | ||||
| 375 | my $exports_from = shift; | ||||
| 376 | my $is_reexport = shift; | ||||
| 377 | |||||
| 378 | # spent 2.64s (31.5ms+2.61) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] which was called 137 times, avg 19.3ms/call:
# 2 times (383µs+16.0ms) by MooseX::Types::import at line 362 of MooseX/Types.pm, avg 8.18ms/call
# 2 times (397µs+13.8ms) by MooseX::Types::import at line 365 of MooseX/Types.pm, avg 7.08ms/call
# once (240µs+61.4ms) by Markdent::Event::StartDocument::BEGIN@11 at line 11 of Markdent/Event/StartDocument.pm
# once (252µs+38.2ms) by Markdent::Handler::HTMLStream::Document::BEGIN@13 at line 13 of Markdent/Handler/HTMLStream/Document.pm
# once (243µs+32.5ms) by Markdent::Handler::HTMLStream::Document::BEGIN@12 at line 12 of Markdent/Handler/HTMLStream/Document.pm
# once (224µs+29.4ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@34 at line 34 of Markdent/Dialect/Standard/BlockParser.pm
# once (248µs+27.7ms) by Markdent::Event::StartParagraph::BEGIN@11 at line 11 of Markdent/Event/StartParagraph.pm
# once (285µs+26.8ms) by Markdent::Parser::BEGIN@17 at line 17 of Markdent/Parser.pm
# once (250µs+26.3ms) by Markdent::Event::AutoLink::BEGIN@12 at line 12 of Markdent/Event/AutoLink.pm
# once (233µs+26.4ms) by Markdent::Event::StartUnorderedList::BEGIN@10 at line 10 of Markdent/Event/StartUnorderedList.pm
# once (225µs+25.0ms) by Markdent::Parser::BEGIN@19 at line 19 of Markdent/Parser.pm
# once (232µs+24.2ms) by Markdent::Event::EndEmphasis::BEGIN@13 at line 13 of Markdent/Event/EndEmphasis.pm
# once (224µs+23.8ms) by Markdent::Event::StartListItem::BEGIN@11 at line 11 of Markdent/Event/StartListItem.pm
# once (226µs+23.7ms) by Markdent::Event::StartCode::BEGIN@13 at line 13 of Markdent/Event/StartCode.pm
# once (223µs+23.7ms) by Markdent::Event::EndCode::BEGIN@12 at line 12 of Markdent/Event/EndCode.pm
# once (242µs+23.6ms) by MooseX::Types::BEGIN@2 at line 2 of MooseX/Types.pm
# once (226µs+23.6ms) by Markdent::Event::StartLink::BEGIN@12 at line 12 of Markdent/Event/StartLink.pm
# once (223µs+23.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@34 at line 34 of Markdent/Dialect/Standard/SpanParser.pm
# once (223µs+23.2ms) by Markdent::Event::EndOrderedList::BEGIN@10 at line 10 of Markdent/Event/EndOrderedList.pm
# once (223µs+22.9ms) by Markdent::Event::Image::BEGIN@13 at line 13 of Markdent/Event/Image.pm
# once (262µs+22.6ms) by Markdent::Event::EndStrong::BEGIN@12 at line 12 of Markdent/Event/EndStrong.pm
# once (245µs+22.4ms) by Markdent::Role::Event::BEGIN@10 at line 10 of Markdent/Role/Event.pm
# once (223µs+22.1ms) by Markdent::Event::StartLink::BEGIN@13 at line 13 of Markdent/Event/StartLink.pm
# once (224µs+22.1ms) by Markdent::Simple::Document::BEGIN@16 at line 16 of Markdent/Simple/Document.pm
# once (222µs+22.1ms) by Markdent::Event::AutoLink::BEGIN@13 at line 13 of Markdent/Event/AutoLink.pm
# once (221µs+22.1ms) by Markdent::Event::HTMLCommentBlock::BEGIN@13 at line 13 of Markdent/Event/HTMLCommentBlock.pm
# once (227µs+22.0ms) by Markdent::Event::HTMLTag::BEGIN@13 at line 13 of Markdent/Event/HTMLTag.pm
# once (292µs+21.9ms) by Markdent::Event::Text::BEGIN@13 at line 13 of Markdent/Event/Text.pm
# once (224µs+21.9ms) by Markdent::Event::StartHTMLTag::BEGIN@13 at line 13 of Markdent/Event/StartHTMLTag.pm
# once (221µs+21.9ms) by Markdent::Event::HTMLComment::BEGIN@13 at line 13 of Markdent/Event/HTMLComment.pm
# once (301µs+21.7ms) by Markdent::Event::StartBlockquote::BEGIN@10 at line 10 of Markdent/Event/StartBlockquote.pm
# once (240µs+21.7ms) by Markdent::Simple::Document::BEGIN@15 at line 15 of Markdent/Simple/Document.pm
# once (225µs+21.7ms) by Markdent::Event::EndCode::BEGIN@13 at line 13 of Markdent/Event/EndCode.pm
# once (235µs+21.7ms) by MooseX::Types::Base::BEGIN@3 at line 3 of MooseX/Types/Base.pm
# once (228µs+21.6ms) by Markdent::Event::HTMLCommentBlock::BEGIN@12 at line 12 of Markdent/Event/HTMLCommentBlock.pm
# once (223µs+21.6ms) by Markdent::Event::StartStrong::BEGIN@13 at line 13 of Markdent/Event/StartStrong.pm
# once (225µs+21.5ms) by Markdent::Event::EndStrong::BEGIN@13 at line 13 of Markdent/Event/EndStrong.pm
# once (221µs+21.5ms) by Markdent::Event::StartEmphasis::BEGIN@13 at line 13 of Markdent/Event/StartEmphasis.pm
# once (222µs+21.5ms) by Markdent::Event::Preformatted::BEGIN@13 at line 13 of Markdent/Event/Preformatted.pm
# once (254µs+21.4ms) by Markdent::Event::HTMLBlock::BEGIN@13 at line 13 of Markdent/Event/HTMLBlock.pm
# once (223µs+21.5ms) by Markdent::Event::HTMLEntity::BEGIN@13 at line 13 of Markdent/Event/HTMLEntity.pm
# once (221µs+21.4ms) by Markdent::Event::EndHeader::BEGIN@13 at line 13 of Markdent/Event/EndHeader.pm
# once (225µs+21.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@32 at line 32 of Markdent/Dialect/Standard/SpanParser.pm
# once (224µs+21.4ms) by Markdent::Event::Text::BEGIN@12 at line 12 of Markdent/Event/Text.pm
# once (222µs+21.4ms) by Markdent::Event::EndHTMLTag::BEGIN@13 at line 13 of Markdent/Event/EndHTMLTag.pm
# once (220µs+21.3ms) by Markdent::Event::StartHeader::BEGIN@13 at line 13 of Markdent/Event/StartHeader.pm
# once (225µs+21.3ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@32 at line 32 of Markdent/Dialect/Standard/BlockParser.pm
# once (254µs+21.2ms) by Markdent::Event::EndParagraph::BEGIN@10 at line 10 of Markdent/Event/EndParagraph.pm
# once (222µs+21.3ms) by Markdent::Event::EndOrderedList::BEGIN@11 at line 11 of Markdent/Event/EndOrderedList.pm
# once (222µs+21.3ms) by Markdent::Event::EndHTMLTag::BEGIN@12 at line 12 of Markdent/Event/EndHTMLTag.pm
# once (225µs+21.2ms) by Markdent::Event::HTMLEntity::BEGIN@12 at line 12 of Markdent/Event/HTMLEntity.pm
# once (222µs+21.2ms) by Markdent::Event::EndUnorderedList::BEGIN@10 at line 10 of Markdent/Event/EndUnorderedList.pm
# once (229µs+21.2ms) by Markdent::Event::HTMLTag::BEGIN@12 at line 12 of Markdent/Event/HTMLTag.pm
# once (227µs+21.2ms) by MooseX::Role::Parameterized::Parameters::BEGIN@2 at line 2 of MooseX/Role/Parameterized/Parameters.pm
# once (221µs+21.2ms) by Markdent::Event::EndLink::BEGIN@11 at line 11 of Markdent/Event/EndLink.pm
# once (222µs+21.2ms) by Markdent::Event::EndListItem::BEGIN@11 at line 11 of Markdent/Event/EndListItem.pm
# once (250µs+21.1ms) by Markdent::Event::StartOrderedList::BEGIN@11 at line 11 of Markdent/Event/StartOrderedList.pm
# once (224µs+21.1ms) by Markdent::Event::StartStrong::BEGIN@12 at line 12 of Markdent/Event/StartStrong.pm
# once (219µs+21.1ms) by Markdent::Event::StartUnorderedList::BEGIN@11 at line 11 of Markdent/Event/StartUnorderedList.pm
# once (233µs+21.1ms) by Markdent::Event::Image::BEGIN@12 at line 12 of Markdent/Event/Image.pm
# once (228µs+21.1ms) by MooseX::Role::Parameterized::Meta::Role::Parameterized::BEGIN@2 at line 2 of MooseX/Role/Parameterized/Meta/Role/Parameterized.pm
# once (225µs+21.1ms) by Markdent::Event::StartHTMLTag::BEGIN@12 at line 12 of Markdent/Event/StartHTMLTag.pm
# once (224µs+21.1ms) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@2 at line 2 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm
# once (270µs+21.1ms) by Markdent::Event::StartHeader::BEGIN@12 at line 12 of Markdent/Event/StartHeader.pm
# once (237µs+21.1ms) by Markdent::Event::EndBlockquote::BEGIN@11 at line 11 of Markdent/Event/EndBlockquote.pm
# once (221µs+21.1ms) by Markdent::Event::StartParagraph::BEGIN@10 at line 10 of Markdent/Event/StartParagraph.pm
# once (221µs+21.1ms) by Markdent::Event::EndHeader::BEGIN@12 at line 12 of Markdent/Event/EndHeader.pm
# once (221µs+21.1ms) by Markdent::Event::EndParagraph::BEGIN@11 at line 11 of Markdent/Event/EndParagraph.pm
# once (220µs+21.1ms) by Markdent::Event::Preformatted::BEGIN@12 at line 12 of Markdent/Event/Preformatted.pm
# once (229µs+21.1ms) by Markdent::Event::EndDocument::BEGIN@10 at line 10 of Markdent/Event/EndDocument.pm
# once (294µs+21.0ms) by Markdent::Event::EndLink::BEGIN@10 at line 10 of Markdent/Event/EndLink.pm
# once (222µs+21.1ms) by Markdent::Event::StartCode::BEGIN@12 at line 12 of Markdent/Event/StartCode.pm
# once (240µs+21.0ms) by Markdent::Event::EndDocument::BEGIN@11 at line 11 of Markdent/Event/EndDocument.pm
# once (255µs+21.0ms) by Markdent::Event::StartEmphasis::BEGIN@12 at line 12 of Markdent/Event/StartEmphasis.pm
# once (221µs+21.0ms) by Markdent::Event::StartDocument::BEGIN@10 at line 10 of Markdent/Event/StartDocument.pm
# once (227µs+21.0ms) by Markdent::Event::EndListItem::BEGIN@10 at line 10 of Markdent/Event/EndListItem.pm
# once (219µs+21.0ms) by Markdent::Event::StartOrderedList::BEGIN@10 at line 10 of Markdent/Event/StartOrderedList.pm
# once (221µs+21.0ms) by Markdent::Event::EndEmphasis::BEGIN@12 at line 12 of Markdent/Event/EndEmphasis.pm
# once (229µs+21.0ms) by Markdent::Event::HTMLComment::BEGIN@12 at line 12 of Markdent/Event/HTMLComment.pm
# once (254µs+21.0ms) by Markdent::Event::EndUnorderedList::BEGIN@11 at line 11 of Markdent/Event/EndUnorderedList.pm
# once (221µs+21.0ms) by Markdent::Event::StartBlockquote::BEGIN@11 at line 11 of Markdent/Event/StartBlockquote.pm
# once (220µs+21.0ms) by Markdent::Event::EndBlockquote::BEGIN@10 at line 10 of Markdent/Event/EndBlockquote.pm
# once (221µs+21.0ms) by MooseX::Role::Parameterized::Meta::Parameter::BEGIN@2 at line 2 of MooseX/Role/Parameterized/Meta/Parameter.pm
# once (221µs+21.0ms) by Markdent::Event::HorizontalRule::BEGIN@11 at line 11 of Markdent/Event/HorizontalRule.pm
# once (220µs+20.9ms) by Markdent::Event::StartListItem::BEGIN@10 at line 10 of Markdent/Event/StartListItem.pm
# once (230µs+20.9ms) by Markdent::Event::HTMLBlock::BEGIN@12 at line 12 of Markdent/Event/HTMLBlock.pm
# once (221µs+20.9ms) by Markdent::Event::HorizontalRule::BEGIN@10 at line 10 of Markdent/Event/HorizontalRule.pm
# once (233µs+20.7ms) by Markdent::Role::BalancedEvent::BEGIN@14 at line 14 of Markdent/Role/BalancedEvent.pm
# once (250µs+19.1ms) by Markdent::Parser::BEGIN@18 at line 18 of Markdent/Parser.pm
# once (223µs+18.4ms) by Markdent::Dialect::Standard::BlockParser::BEGIN@33 at line 33 of Markdent/Dialect/Standard/BlockParser.pm
# once (225µs+18.4ms) by Markdent::Dialect::Standard::SpanParser::BEGIN@33 at line 33 of Markdent/Dialect/Standard/SpanParser.pm
# once (222µs+15.6ms) by MooseX::StrictConstructor::Role::Meta::Class::BEGIN@12 at line 12 of MooseX/StrictConstructor/Role/Meta/Class.pm
# once (249µs+14.4ms) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@9 at line 9 of MooseX/SemiAffordanceAccessor/Role/Attribute.pm
# once (226µs+13.9ms) by Moose::Meta::Method::Accessor::Native::Array::elements::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/elements.pm
# once (233µs+13.7ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@2 at line 2 of Moose/Meta/Attribute/Native/Trait/String.pm
# once (226µs+13.7ms) by Moose::Meta::Method::Accessor::Native::Array::Writer::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/Writer.pm
# once (223µs+13.7ms) by Moose::Meta::Method::Accessor::Native::Bool::unset::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Bool/unset.pm
# once (222µs+13.7ms) by Moose::Meta::Method::Accessor::Native::Hash::Writer::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/Writer.pm
# once (222µs+13.7ms) by Moose::Meta::Method::Accessor::Native::String::clear::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/String/clear.pm
# once (224µs+13.6ms) by Moose::Meta::Method::Accessor::Native::Array::push::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/push.pm
# once (226µs+13.6ms) by Markdent::Role::AnyParser::BEGIN@10 at line 10 of Markdent/Role/AnyParser.pm
# once (266µs+13.6ms) by Markdent::Role::EventAsText::BEGIN@10 at line 10 of Markdent/Role/EventAsText.pm
# once (238µs+13.6ms) by Moose::Meta::Method::Accessor::Native::Hash::get::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Hash/get.pm
# once (238µs+13.6ms) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait/Array.pm
# once (224µs+13.6ms) by Moose::Meta::Method::Accessor::Native::Counter::dec::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Counter/dec.pm
# once (224µs+13.6ms) by Moose::Meta::Method::Accessor::Native::Bool::set::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Bool/set.pm
# once (225µs+13.6ms) by Moose::Meta::Method::Accessor::Native::String::append::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/String/append.pm
# once (225µs+13.5ms) by Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor/Native/Hash/set.pm
# once (225µs+13.5ms) by Moose::Meta::Attribute::Native::Trait::Bool::BEGIN@2 at line 2 of Moose/Meta/Attribute/Native/Trait/Bool.pm
# once (223µs+13.5ms) by Moose::Meta::Method::Accessor::Native::Hash::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Hash.pm
# once (224µs+13.5ms) by Moose::Meta::Method::Accessor::Native::Counter::inc::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Counter/inc.pm
# once (223µs+13.5ms) by Moose::Meta::Method::Accessor::Native::String::length::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/String/length.pm
# once (229µs+13.5ms) by Moose::Meta::Attribute::Native::Trait::Counter::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait/Counter.pm
# once (225µs+13.5ms) by Moose::Meta::Method::Accessor::Native::Reader::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Reader.pm
# once (225µs+13.5ms) by Markdent::Role::BlockParser::BEGIN@10 at line 10 of Markdent/Role/BlockParser.pm
# once (253µs+13.5ms) by Moose::Meta::Method::Accessor::Native::Collection::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Collection.pm
# once (222µs+13.5ms) by MooseX::StrictConstructor::Role::Object::BEGIN@9 at line 9 of MooseX/StrictConstructor/Role/Object.pm
# once (222µs+13.5ms) by Moose::Meta::Method::Accessor::Native::Array::clear::BEGIN@10 at line 10 of Moose/Meta/Method/Accessor/Native/Array/clear.pm
# once (258µs+13.4ms) by MooseX::Role::Parameterized::Meta::Trait::Parameterized::BEGIN@2 at line 2 of MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm
# once (227µs+13.5ms) by Moose::Meta::Attribute::Native::Trait::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait.pm
# once (222µs+13.4ms) by Moose::Meta::Method::Accessor::Native::Array::BEGIN@6 at line 6 of Moose/Meta/Method/Accessor/Native/Array.pm
# once (220µs+13.4ms) by Markdent::Role::Handler::BEGIN@10 at line 10 of Markdent/Role/Handler.pm
# once (228µs+13.4ms) by Markdent::Role::SpanParser::BEGIN@10 at line 10 of Markdent/Role/SpanParser.pm
# once (235µs+13.4ms) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@3 at line 3 of Moose/Meta/Attribute/Native/Trait/Hash.pm
# once (288µs+13.3ms) by Markdent::Role::DebugPrinter::BEGIN@12 at line 12 of Markdent/Role/DebugPrinter.pm
# once (224µs+13.4ms) by Markdent::Role::HTMLStream::BEGIN@18 at line 18 of Markdent/Role/HTMLStream.pm
# once (226µs+13.3ms) by Moose::Meta::Method::Accessor::Native::Writer::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Writer.pm
# once (224µs+13.3ms) by Markdent::Role::EventsAsMethods::BEGIN@12 at line 12 of Markdent/Role/EventsAsMethods.pm
# once (236µs+13.2ms) by Moose::Meta::Method::Accessor::Native::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor/Native.pm
# once (201µs+12.0ms) by MooseX::Types::Base::BEGIN@14 at line 14 of MooseX/Types/Base.pm
# once (227µs+9.65ms) by MooseX::Types::BEGIN@10 at line 10 of MooseX/Types.pm
# once (205µs+9.62ms) by Moose::Meta::Attribute::Native::Trait::BEGIN@6 at line 6 of Moose/Meta/Attribute/Native/Trait.pm
# once (259µs+8.10ms) by Moose::BEGIN@35 at line 35 of Moose.pm
# once (195µs+7.83ms) by Moose::Role::BEGIN@19 at line 19 of Moose/Role.pm
# once (221µs+2.08ms) by MooseX::Params::Validate::BEGIN@10 at line 10 of MooseX/Params/Validate.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 | 3387 | 30.8ms | my $traits; | ||
| 389 | 137 | 7.84ms | ( $traits, @_ ) = _strip_traits(@_); # spent 7.84ms making 137 calls to Moose::Exporter::_strip_traits, avg 57µs/call | ||
| 390 | |||||
| 391 | my $metaclass; | ||||
| 392 | 137 | 5.78ms | ( $metaclass, @_ ) = _strip_metaclass(@_); # spent 5.78ms making 137 calls to Moose::Exporter::_strip_metaclass, avg 42µs/call | ||
| 393 | $metaclass | ||||
| 394 | = Moose::Util::resolve_metaclass_alias( 'Class' => $metaclass ) | ||||
| 395 | if defined $metaclass && length $metaclass; | ||||
| 396 | |||||
| 397 | my $meta_name; | ||||
| 398 | 137 | 5.78ms | ( $meta_name, @_ ) = _strip_meta_name(@_); # spent 5.78ms making 137 calls to Moose::Exporter::_strip_meta_name, avg 42µ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 | 137 | 2.06ms | $CALLER = _get_caller(@_); # spent 2.06ms making 137 calls to Moose::Exporter::_get_caller, avg 15µ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 | 137 | 1.93ms | strict->import; # spent 1.93ms making 137 calls to strict::import, avg 14µs/call | ||
| 414 | 137 | 9.66ms | warnings->import; # spent 9.66ms making 137 calls to warnings::import, avg 71µs/call | ||
| 415 | |||||
| 416 | my $did_init_meta; | ||||
| 417 | 137 | 1.65ms | for my $c ( grep { $_->can('init_meta') } $class, @{$exports_from} ) { # spent 1.65ms making 137 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 | 127 | 1.73s | $c->init_meta( # spent 925ms making 42 calls to Moose::Exporter::__ANON__[Moose/Exporter.pm:643], avg 22.0ms/call
# spent 618ms making 45 calls to Moose::init_meta, avg 13.7ms/call
# spent 170ms making 38 calls to Moose::Role::init_meta, avg 4.46ms/call
# spent 21.4ms making 2 calls to MooseX::Role::Parameterized::init_meta, avg 10.7ms/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 | 137 | 839ms | $class->$exporter( $extra, @args ); # spent 839ms making 137 calls to Sub::Exporter::__ANON__[Sub/Exporter.pm:756], avg 6.12ms/call | ||
| 456 | }; | ||||
| 457 | } | ||||
| 458 | |||||
| 459 | # spent 7.84ms (5.39+2.44) within Moose::Exporter::_strip_traits which was called 137 times, avg 57µs/call:
# 137 times (5.39ms+2.44ms) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 389, avg 57µs/call | ||||
| 460 | 418 | 8.34ms | 137 | 2.44ms | my $idx = first_index { ( $_ || '' ) eq '-traits' } @_; # spent 2.44ms making 137 calls to List::MoreUtils::firstidx, avg 18µ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 5.78ms (4.23+1.56) within Moose::Exporter::_strip_metaclass which was called 137 times, avg 42µs/call:
# 137 times (4.23ms+1.56ms) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 392, avg 42µs/call | ||||
| 474 | 418 | 6.13ms | 137 | 1.56ms | my $idx = first_index { ( $_ || '' ) eq '-metaclass' } @_; # spent 1.56ms making 137 calls to List::MoreUtils::firstidx, avg 11µ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 5.78ms (4.25+1.53) within Moose::Exporter::_strip_meta_name which was called 137 times, avg 42µs/call:
# 137 times (4.25ms+1.53ms) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 398, avg 42µs/call | ||||
| 486 | 418 | 6.18ms | 137 | 1.53ms | my $idx = first_index { ( $_ || '' ) eq '-meta_name' } @_; # spent 1.53ms making 137 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 2.06ms within Moose::Exporter::_get_caller which was called 137 times, avg 15µs/call:
# 137 times (2.06ms+0s) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 405, avg 15µs/call | ||||
| 530 | |||||
| 531 | # 1 extra level because it's called by import so there's a layer | ||||
| 532 | # of indirection | ||||
| 533 | 274 | 2.61ms | 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 212µs within Moose::Exporter::_make_unimport_sub which was called 7 times, avg 30µs/call:
# 7 times (212µs+0s) by Moose::Exporter::build_import_methods at line 63, avg 30µs/call | ||||
| 543 | 42 | 232µs | shift; | ||
| 544 | my $exporting_package = shift; | ||||
| 545 | my $exports = shift; | ||||
| 546 | my $export_recorder = shift; | ||||
| 547 | my $is_reexport = shift; | ||||
| 548 | |||||
| 549 | # spent 24.5ms (1.60+22.9) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:557] which was called 34 times, avg 720µs/call:
# once (59µs+1.10ms) by Moose::Meta::Attribute::Native::Trait::Counter::BEGIN@17 at line 17 of Moose/Meta/Attribute/Native/Trait/Counter.pm
# once (45µs+794µs) by Moose::Meta::Method::Accessor::Native::Counter::dec::BEGIN@39 at line 39 of Moose/Meta/Method/Accessor/Native/Counter/dec.pm
# once (48µs+723µs) by Moose::Meta::Method::Accessor::Native::String::append::BEGIN@40 at line 40 of Moose/Meta/Method/Accessor/Native/String/append.pm
# once (51µs+716µs) by Moose::Meta::Attribute::Native::Trait::Bool::BEGIN@13 at line 13 of Moose/Meta/Attribute/Native/Trait/Bool.pm
# once (45µs+717µs) by Moose::Meta::Method::Accessor::Native::String::length::BEGIN@24 at line 24 of Moose/Meta/Method/Accessor/Native/String/length.pm
# once (44µs+718µs) by Moose::Meta::Method::Accessor::Native::String::clear::BEGIN@32 at line 32 of Moose/Meta/Method/Accessor/Native/String/clear.pm
# once (43µs+718µs) by Moose::Meta::Method::Accessor::Native::Array::BEGIN@28 at line 28 of Moose/Meta/Method/Accessor/Native/Array.pm
# once (44µs+715µs) by Moose::Meta::Method::Accessor::Native::Array::push::BEGIN@44 at line 44 of Moose/Meta/Method/Accessor/Native/Array/push.pm
# once (45µs+709µs) by Moose::Meta::Method::Accessor::Native::Counter::inc::BEGIN@39 at line 39 of Moose/Meta/Method/Accessor/Native/Counter/inc.pm
# once (43µs+706µs) by Moose::Meta::Method::Accessor::Native::Array::clear::BEGIN@37 at line 37 of Moose/Meta/Method/Accessor/Native/Array/clear.pm
# once (44µs+698µs) by Moose::Meta::Method::Accessor::Native::Hash::get::BEGIN@45 at line 45 of Moose/Meta/Method/Accessor/Native/Hash/get.pm
# once (44µs+697µs) by Moose::Meta::Method::Accessor::Native::Array::elements::BEGIN@24 at line 24 of Moose/Meta/Method/Accessor/Native/Array/elements.pm
# once (48µs+679µs) by Moose::Meta::Method::Accessor::Native::Hash::BEGIN@26 at line 26 of Moose/Meta/Method/Accessor/Native/Hash.pm
# once (44µs+679µs) by Moose::Meta::Method::Accessor::Native::Bool::unset::BEGIN@32 at line 32 of Moose/Meta/Method/Accessor/Native/Bool/unset.pm
# once (44µs+678µs) by Moose::Meta::Method::Accessor::Native::Bool::set::BEGIN@32 at line 32 of Moose/Meta/Method/Accessor/Native/Bool/set.pm
# once (45µs+672µs) by Moose::Meta::Method::Accessor::Native::Hash::set::BEGIN@116 at line 116 of Moose/Meta/Method/Accessor/Native/Hash/set.pm
# once (43µs+673µs) by Moose::Meta::Method::Accessor::Native::Hash::Writer::BEGIN@29 at line 29 of Moose/Meta/Method/Accessor/Native/Hash/Writer.pm
# once (44µs+671µs) by MooseX::StrictConstructor::Role::Meta::Class::BEGIN@37 at line 37 of MooseX/StrictConstructor/Role/Meta/Class.pm
# once (45µs+661µs) by Moose::Meta::Method::Accessor::Native::Collection::BEGIN@149 at line 149 of Moose/Meta/Method/Accessor/Native/Collection.pm
# once (56µs+650µs) by Moose::Meta::Method::Accessor::Native::Writer::BEGIN@177 at line 177 of Moose/Meta/Method/Accessor/Native/Writer.pm
# once (43µs+660µs) by Moose::Meta::Method::Accessor::Native::Reader::BEGIN@48 at line 48 of Moose/Meta/Method/Accessor/Native/Reader.pm
# once (42µs+656µs) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@14 at line 14 of Moose/Meta/Attribute/Native/Trait/String.pm
# once (47µs+645µs) by MooseX::Role::Parameterized::Meta::Trait::Parameterized::BEGIN@19 at line 19 of MooseX/Role/Parameterized/Meta/Trait/Parameterized.pm
# once (42µs+648µs) by Moose::Meta::Attribute::Native::Trait::Array::BEGIN@13 at line 13 of Moose/Meta/Attribute/Native/Trait/Array.pm
# once (42µs+645µs) by Moose::Meta::Attribute::Native::Trait::Hash::BEGIN@13 at line 13 of Moose/Meta/Attribute/Native/Trait/Hash.pm
# once (55µs+627µs) by Moose::Meta::Method::Accessor::Native::BEGIN@153 at line 153 of Moose/Meta/Method/Accessor/Native.pm
# once (45µs+635µs) by Moose::Meta::Attribute::Native::Trait::BEGIN@198 at line 198 of Moose/Meta/Attribute/Native/Trait.pm
# once (45µs+613µs) by Moose::Meta::Attribute::Native::Trait::BEGIN@199 at line 199 of Moose/Meta/Attribute/Native/Trait.pm
# once (48µs+608µs) by MooseX::SemiAffordanceAccessor::Role::Attribute::BEGIN@36 at line 36 of MooseX/SemiAffordanceAccessor/Role/Attribute.pm
# once (101µs+534µs) by MooseX::Role::Parameterized::Parameters::BEGIN@7 at line 7 of MooseX/Role/Parameterized/Parameters.pm
# once (42µs+580µs) by MooseX::StrictConstructor::Role::Object::BEGIN@32 at line 32 of MooseX/StrictConstructor/Role/Object.pm
# once (45µs+566µs) by MooseX::Role::Parameterized::Meta::Role::Parameterizable::BEGIN@131 at line 131 of MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm
# once (42µs+552µs) by MooseX::Role::Parameterized::Meta::Parameter::BEGIN@27 at line 27 of MooseX/Role/Parameterized/Meta/Parameter.pm
# once (41µs+539µs) by MooseX::Role::Parameterized::Meta::Role::Parameterized::BEGIN@9 at line 9 of MooseX/Role/Parameterized/Meta/Role/Parameterized.pm | ||||
| 550 | 68 | 1.79ms | my $caller = scalar caller(); | ||
| 551 | Moose::Exporter->_remove_keywords( | ||||
| 552 | $caller, | ||||
| 553 | 34 | 22.9ms | [ keys %{$exports} ], # spent 22.9ms making 34 calls to Moose::Exporter::_remove_keywords, avg 673µs/call | ||
| 554 | $export_recorder, | ||||
| 555 | $is_reexport, | ||||
| 556 | ); | ||||
| 557 | }; | ||||
| 558 | } | ||||
| 559 | |||||
| 560 | # spent 22.9ms (22.5+423µs) within Moose::Exporter::_remove_keywords which was called 34 times, avg 673µs/call:
# 34 times (22.5ms+423µs) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:557] at line 553, avg 673µs/call | ||||
| 561 | 2623 | 23.1ms | shift; | ||
| 562 | my $package = shift; | ||||
| 563 | my $keywords = shift; | ||||
| 564 | my $recorded_exports = shift; | ||||
| 565 | my $is_reexport = shift; | ||||
| 566 | |||||
| 567 | 3 | 283µs | 2 | 240µs | # spent 146µs (53+94) within Moose::Exporter::BEGIN@567 which was called:
# once (53µs+94µs) by Moose::BEGIN@15 at line 567 # spent 146µs making 1 call to Moose::Exporter::BEGIN@567
# spent 94µ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.18ms | 2 | 160µs | # spent 100µs (40+60) within Moose::Exporter::BEGIN@577 which was called:
# once (40µs+60µs) by Moose::BEGIN@15 at line 577 # spent 100µ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 | 66 | 423µs | \*{ join q{::} => $package, $name } ); # spent 423µs making 66 calls to Moose::Exporter::_export_is_flagged, avg 6µ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 747µs within Moose::Exporter::_make_init_meta which was called 7 times, avg 107µs/call:
# 7 times (747µs+0s) by Moose::Exporter::build_import_methods at line 70, avg 107µs/call | ||||
| 590 | 121 | 760µ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 | # spent 925ms (5.44+920) within Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:643] which was called 42 times, avg 22.0ms/call:
# 42 times (5.44ms+920ms) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:456] at line 423, avg 22.0ms/call | ||||
| 622 | 252 | 5.23ms | shift; | ||
| 623 | my %options = @_; | ||||
| 624 | |||||
| 625 | 42 | 1.54ms | return unless Class::MOP::class_of( $options{for_class} ); # spent 1.54ms making 42 calls to Class::MOP::class_of, avg 37µs/call | ||
| 626 | |||||
| 627 | 1 | 1.47ms | 84 | 644ms | if ( %new_style_roles || %old_style_roles ) { # spent 641ms making 42 calls to Moose::Util::MetaRole::apply_metaroles, avg 15.3ms/call
# spent 2.75ms making 42 calls to Class::MOP::Class::DESTROY, avg 65µs/call |
| 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 | 126 | 276ms | for_class => $options{for_class}, # spent 274ms making 42 calls to Moose::Util::MetaRole::apply_base_class_roles, avg 6.52ms/call
# spent 1.52ms making 42 calls to Class::MOP::class_of, avg 36µs/call
# spent 319µs making 42 calls to UNIVERSAL::isa, avg 8µs/call | ||
| 637 | %base_class_roles, | ||||
| 638 | ) | ||||
| 639 | if Class::MOP::class_of( $options{for_class} ) | ||||
| 640 | ->isa('Moose::Meta::Class'); | ||||
| 641 | |||||
| 642 | 42 | 1.19ms | return Class::MOP::class_of( $options{for_class} ); # spent 1.19ms making 42 calls to Class::MOP::class_of, avg 28µs/call | ||
| 643 | }; | ||||
| 644 | } | ||||
| 645 | |||||
| 646 | # spent 970µs (365+605) within Moose::Exporter::import which was called 7 times, avg 139µs/call:
# once (108µs+82µs) by MooseX::StrictConstructor::BEGIN@10 at line 10 of MooseX/StrictConstructor.pm
# once (50µs+103µs) by Moose::BEGIN@15 at line 15 of Moose.pm
# once (42µs+92µs) by Moose::Role::BEGIN@17 at line 17 of Moose/Role.pm
# once (41µs+91µs) by MooseX::SemiAffordanceAccessor::BEGIN@10 at line 10 of MooseX/SemiAffordanceAccessor.pm
# once (42µs+81µs) by MooseX::Role::Parameterized::BEGIN@4 at line 4 of MooseX/Role/Parameterized.pm
# once (42µs+78µs) by Moose::Util::TypeConstraints::BEGIN@7 at line 7 of Moose/Util/TypeConstraints.pm
# once (40µs+78µs) by MooseX::Types::CheckedUtilExports::BEGIN@14 at line 14 of MooseX/Types/CheckedUtilExports.pm | ||||
| 647 | 14 | 260µs | 7 | 95µs | strict->import; # spent 95µs making 7 calls to strict::import, avg 14µs/call |
| 648 | 7 | 510µs | warnings->import; # spent 510µs making 7 calls to warnings::import, avg 73µs/call | ||
| 649 | } | ||||
| 650 | |||||
| 651 | 1 | 25µs | 1; | ||
| 652 | |||||
| 653 | __END__ | ||||
# spent 423µs within Moose::Exporter::_export_is_flagged which was called 66 times, avg 6µs/call:
# 66 times (423µs+0s) by Moose::Exporter::_remove_keywords at line 580, avg 6µs/call | |||||
# spent 1.13ms within Moose::Exporter::_flag_as_reexport which was called 163 times, avg 7µs/call:
# 163 times (1.13ms+0s) by Moose::Exporter::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Exporter.pm:125] at line 123, avg 7µs/call |