| Filename | /home/doy/coding/src/namespace-clean/namespace-clean-0.18/blib/lib/namespace/clean.pm |
| Statements | Executed 12414 statements in 332ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 46 | 1 | 1 | 139ms | 266ms | namespace::clean::__ANON__[:59] |
| 46 | 46 | 46 | 23.5ms | 80.1ms | namespace::clean::import |
| 46 | 1 | 1 | 10.3ms | 28.9ms | namespace::clean::get_functions |
| 46 | 1 | 1 | 3.14ms | 7.56ms | namespace::clean::get_class_store |
| 1 | 1 | 1 | 2.06ms | 11.3ms | namespace::clean::BEGIN@17 |
| 1 | 1 | 1 | 1.99ms | 4.17ms | namespace::clean::BEGIN@15 |
| 46 | 1 | 1 | 1.67ms | 268ms | namespace::clean::__ANON__[:117] |
| 46 | 1 | 1 | 485µs | 485µs | namespace::clean::CORE:match (opcode) |
| 1 | 1 | 1 | 75µs | 351µs | namespace::clean::BEGIN@14 |
| 1 | 1 | 1 | 69µs | 152µs | namespace::clean::BEGIN@16 |
| 1 | 1 | 1 | 68µs | 160µs | namespace::clean::BEGIN@166 |
| 1 | 1 | 1 | 52µs | 123µs | namespace::clean::BEGIN@10 |
| 1 | 1 | 1 | 48µs | 48µs | namespace::clean::BEGIN@2 |
| 1 | 1 | 1 | 38µs | 53µs | namespace::clean::BEGIN@11 |
| 1 | 1 | 1 | 36µs | 150µs | namespace::clean::BEGIN@13 |
| 1 | 1 | 1 | 17µs | 17µs | namespace::clean::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | namespace::clean::__ANON__[:90] |
| 0 | 0 | 0 | 0s | 0s | namespace::clean::clean_subroutines |
| 0 | 0 | 0 | 0s | 0s | namespace::clean::deleted::KiokuDB::TypeMap::Entry::MOP::does_role |
| 0 | 0 | 0 | 0s | 0s | namespace::clean::unimport |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package namespace::clean; | ||||
| 2 | # spent 48µs within namespace::clean::BEGIN@2 which was called:
# once (48µs+0s) by KiokuDB::Backend::BEGIN@9 at line 4 | ||||
| 3 | 1 | 27µs | $namespace::clean::AUTHORITY = 'cpan:PHAYLON'; | ||
| 4 | 1 | 83µs | 1 | 48µs | } # spent 48µs making 1 call to namespace::clean::BEGIN@2 |
| 5 | # spent 17µs within namespace::clean::BEGIN@5 which was called:
# once (17µs+0s) by KiokuDB::Backend::BEGIN@9 at line 7 | ||||
| 6 | 1 | 19µs | $namespace::clean::VERSION = '0.18'; | ||
| 7 | 1 | 66µs | 1 | 17µs | } # spent 17µs making 1 call to namespace::clean::BEGIN@5 |
| 8 | # ABSTRACT: Keep imports and functions out of your namespace | ||||
| 9 | |||||
| 10 | 3 | 97µs | 2 | 195µs | # spent 123µs (52+71) within namespace::clean::BEGIN@10 which was called:
# once (52µs+71µs) by KiokuDB::Backend::BEGIN@9 at line 10 # spent 123µs making 1 call to namespace::clean::BEGIN@10
# spent 71µs making 1 call to warnings::import |
| 11 | 3 | 130µs | 2 | 69µs | # spent 53µs (38+15) within namespace::clean::BEGIN@11 which was called:
# once (38µs+15µs) by KiokuDB::Backend::BEGIN@9 at line 11 # spent 53µs making 1 call to namespace::clean::BEGIN@11
# spent 15µs making 1 call to strict::import |
| 12 | |||||
| 13 | 3 | 114µs | 2 | 264µs | # spent 150µs (36+114) within namespace::clean::BEGIN@13 which was called:
# once (36µs+114µs) by KiokuDB::Backend::BEGIN@9 at line 13 # spent 150µs making 1 call to namespace::clean::BEGIN@13
# spent 114µs making 1 call to vars::import |
| 14 | 3 | 282µs | 3 | 627µs | # spent 351µs (75+276) within namespace::clean::BEGIN@14 which was called:
# once (75µs+276µs) by KiokuDB::Backend::BEGIN@9 at line 14 # spent 351µs making 1 call to namespace::clean::BEGIN@14
# spent 151µs making 1 call to Exporter::import
# spent 125µs making 1 call to UNIVERSAL::VERSION |
| 15 | 3 | 729µs | 3 | 4.49ms | # spent 4.17ms (1.99+2.18) within namespace::clean::BEGIN@15 which was called:
# once (1.99ms+2.18ms) by KiokuDB::Backend::BEGIN@9 at line 15 # spent 4.17ms making 1 call to namespace::clean::BEGIN@15
# spent 242µs making 1 call to Exporter::import
# spent 80µs making 1 call to UNIVERSAL::VERSION |
| 16 | 3 | 184µs | 3 | 235µs | # spent 152µs (69+83) within namespace::clean::BEGIN@16 which was called:
# once (69µs+83µs) by KiokuDB::Backend::BEGIN@9 at line 16 # spent 152µs making 1 call to namespace::clean::BEGIN@16
# spent 51µs making 1 call to UNIVERSAL::VERSION
# spent 32µs making 1 call to Package::DeprecationManager::__ANON__[Package/DeprecationManager.pm:61] |
| 17 | 3 | 4.39ms | 3 | 13.1ms | # spent 11.3ms (2.06+9.27) within namespace::clean::BEGIN@17 which was called:
# once (2.06ms+9.27ms) by KiokuDB::Backend::BEGIN@9 at line 17 # spent 11.3ms making 1 call to namespace::clean::BEGIN@17
# spent 1.65ms making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
# spent 75µs making 1 call to UNIVERSAL::VERSION |
| 18 | |||||
| 19 | 1 | 5µs | $STORAGE_VAR = '__NAMESPACE_CLEAN_STORAGE'; | ||
| 20 | |||||
| 21 | |||||
| 22 | # spent 266ms (139+127) within namespace::clean::__ANON__[/home/doy/coding/src/namespace-clean/namespace-clean-0.18/blib/lib/namespace/clean.pm:59] which was called 46 times, avg 5.79ms/call:
# 46 times (139ms+127ms) by namespace::clean::__ANON__[/home/doy/coding/src/namespace-clean/namespace-clean-0.18/blib/lib/namespace/clean.pm:117] at line 116, avg 5.79ms/call | ||||
| 23 | |||||
| 24 | 230 | 5.77ms | my $cleanee = shift; | ||
| 25 | my $store = shift; | ||||
| 26 | 46 | 993µs | my $cleanee_stash = Package::Stash->new($cleanee); # spent 993µs making 46 calls to Package::Stash::XS::new, avg 22µs/call | ||
| 27 | 46 | 1.20ms | my $deleted_stash = Package::Stash->new("namespace::clean::deleted::$cleanee"); # spent 1.20ms making 46 calls to Package::Stash::XS::new, avg 26µs/call | ||
| 28 | SYMBOL: | ||||
| 29 | for my $f (@_) { | ||||
| 30 | 4753 | 164ms | my $variable = "&$f"; | ||
| 31 | # ignore already removed symbols | ||||
| 32 | next SYMBOL if $store->{exclude}{ $f }; | ||||
| 33 | |||||
| 34 | 1358 | 18.3ms | next SYMBOL unless $cleanee_stash->has_symbol($variable); # spent 15.4ms making 679 calls to Package::Stash::XS::has_symbol, avg 23µs/call
# spent 2.86ms making 679 calls to Package::Stash::XS::namespace, avg 4µs/call | ||
| 35 | |||||
| 36 | 1358 | 40.9ms | 679 | 3.13ms | if (ref(\$cleanee_stash->namespace->{$f}) eq 'GLOB') { # spent 3.13ms making 679 calls to Package::Stash::XS::namespace, avg 5µs/call |
| 37 | # convince the Perl debugger to work | ||||
| 38 | # it assumes that sub_fullname($sub) can always be used to find the CV again | ||||
| 39 | # since we are deleting the glob where the subroutine was originally | ||||
| 40 | # defined, that assumption no longer holds, so we need to move it | ||||
| 41 | # elsewhere and point the CV's name to the new glob. | ||||
| 42 | 1358 | 17.4ms | my $sub = $cleanee_stash->get_symbol($variable); # spent 14.7ms making 679 calls to Package::Stash::XS::get_symbol, avg 22µs/call
# spent 2.68ms making 679 calls to Package::Stash::XS::namespace, avg 4µs/call | ||
| 43 | 3 | 137µs | 1358 | 20.2ms | if ( sub_fullname($sub) eq ($cleanee_stash->name . "::$f") ) { # spent 16.8ms making 679 calls to Sub::Identify::sub_fullname, avg 25µs/call
# spent 3.40ms making 679 calls to Package::Stash::XS::name, avg 5µs/call |
| 44 | 1 | 4µs | my $new_fq = $deleted_stash->name . "::$f"; # spent 4µs making 1 call to Package::Stash::XS::name | ||
| 45 | 1 | 21µs | subname($new_fq, $sub); # spent 21µs making 1 call to Sub::Name::subname | ||
| 46 | 2 | 57µs | $deleted_stash->add_symbol($variable, $sub); # spent 53µs making 1 call to Package::Stash::XS::add_symbol
# spent 4µs making 1 call to Package::Stash::XS::name | ||
| 47 | } | ||||
| 48 | } | ||||
| 49 | |||||
| 50 | my ($scalar, $array, $hash, $io) = map { | ||||
| 51 | 5432 | 64.3ms | $cleanee_stash->get_symbol($_ . $f) # spent 53.7ms making 2716 calls to Package::Stash::XS::get_symbol, avg 20µs/call
# spent 10.6ms making 2716 calls to Package::Stash::XS::namespace, avg 4µs/call | ||
| 52 | } '$', '@', '%', ''; | ||||
| 53 | 1358 | 20.6ms | $cleanee_stash->remove_glob($f); # spent 18.0ms making 679 calls to Package::Stash::XS::remove_glob, avg 26µs/call
# spent 2.60ms making 679 calls to Package::Stash::XS::namespace, avg 4µs/call | ||
| 54 | for my $var (['$', $scalar], ['@', $array], ['%', $hash], ['', $io]) { | ||||
| 55 | 2716 | 37.6ms | next unless defined $var->[1]; | ||
| 56 | $cleanee_stash->add_symbol($var->[0] . $f, $var->[1]); | ||||
| 57 | } | ||||
| 58 | } | ||||
| 59 | 1 | 22µs | }; | ||
| 60 | |||||
| 61 | sub clean_subroutines { | ||||
| 62 | my ($nc, $cleanee, @subs) = @_; | ||||
| 63 | $RemoveSubs->($cleanee, {}, @subs); | ||||
| 64 | } | ||||
| 65 | |||||
| 66 | |||||
| 67 | # spent 80.1ms (23.5+56.7) within namespace::clean::import which was called 46 times, avg 1.74ms/call:
# once (1.25ms+3.15ms) by KiokuDB::Backend::BEGIN@9 at line 9 of KiokuDB/Backend.pm
# once (895µs+2.20ms) by KiokuDB::LiveObjects::BEGIN@18 at line 18 of KiokuDB/LiveObjects.pm
# once (782µs+1.96ms) by KiokuDB::Entry::BEGIN@8 at line 8 of KiokuDB/Entry.pm
# once (725µs+1.90ms) by KiokuDB::TypeMap::Entry::BEGIN@6 at line 6 of KiokuDB/TypeMap/Entry.pm
# once (558µs+1.36ms) by KiokuDB::Collapser::BEGIN@22 at line 22 of KiokuDB/Collapser.pm
# once (547µs+1.36ms) by KiokuDB::Role::UUIDs::LibUUID::BEGIN@8 at line 8 of KiokuDB/Role/UUIDs/LibUUID.pm
# once (575µs+1.32ms) by KiokuDB::BEGIN@23 at line 23 of KiokuDB.pm
# once (542µs+1.32ms) by MooseX::Clone::Meta::Attribute::Trait::Copy::BEGIN@8 at line 8 of MooseX/Clone/Meta/Attribute/Trait/Copy.pm
# once (558µs+1.29ms) by KiokuDB::TypeMap::BEGIN@12 at line 12 of KiokuDB/TypeMap.pm
# once (516µs+1.27ms) by KiokuDB::Linker::BEGIN@20 at line 20 of KiokuDB/Linker.pm
# once (490µs+1.30ms) by MooseX::Clone::Meta::Attribute::Trait::StrableClone::BEGIN@8 at line 8 of MooseX/Clone/Meta/Attribute/Trait/StorableClone.pm
# once (528µs+1.24ms) by KiokuDB::Role::UUIDs::BEGIN@8 at line 8 of KiokuDB/Role/UUIDs.pm
# once (508µs+1.24ms) by Data::Visitor::BEGIN@14 at line 14 of Data/Visitor.pm
# once (496µs+1.24ms) by KiokuDB::TypeMap::Entry::MOP::BEGIN@19 at line 19 of KiokuDB/TypeMap/Entry/MOP.pm
# once (486µs+1.23ms) by MooseX::Clone::BEGIN@15 at line 15 of MooseX/Clone.pm
# once (473µs+1.20ms) by KiokuDB::TypeMap::Entry::Std::BEGIN@8 at line 8 of KiokuDB/TypeMap/Entry/Std.pm
# once (483µs+1.19ms) by MooseX::Clone::Meta::Attribute::Trait::Clone::BEGIN@8 at line 8 of MooseX/Clone/Meta/Attribute/Trait/Clone.pm
# once (484µs+1.19ms) by KiokuDB::Error::BEGIN@4 at line 4 of KiokuDB/Error.pm
# once (482µs+1.18ms) by KiokuDB::TypeMap::Entry::Std::ID::BEGIN@4 at line 4 of KiokuDB/TypeMap/Entry/Std/ID.pm
# once (541µs+1.11ms) by KiokuDB::Role::API::BEGIN@4 at line 4 of KiokuDB/Role/API.pm
# once (480µs+1.17ms) by KiokuDB::TypeMap::Entry::Std::Expand::BEGIN@6 at line 6 of KiokuDB/TypeMap/Entry/Std/Expand.pm
# once (500µs+1.14ms) by Data::Stream::Bulk::BEGIN@12 at line 12 of Data/Stream/Bulk.pm
# once (467µs+1.17ms) by KiokuDB::TypeMap::Entry::Std::Intrinsic::BEGIN@6 at line 6 of KiokuDB/TypeMap/Entry/Std/Intrinsic.pm
# once (471µs+1.16ms) by KiokuDB::Role::TypeMap::BEGIN@6 at line 6 of KiokuDB/Role/TypeMap.pm
# once (467µs+1.12ms) by MooseX::Clone::Meta::Attribute::Trait::Clone::Base::BEGIN@6 at line 6 of MooseX/Clone/Meta/Attribute/Trait/Clone/Base.pm
# once (464µs+1.12ms) by KiokuDB::TypeMap::Entry::Std::Compile::BEGIN@6 at line 6 of KiokuDB/TypeMap/Entry/Std/Compile.pm
# once (476µs+1.11ms) by MooseX::Clone::Meta::Attribute::Trait::NoClone::BEGIN@6 at line 6 of MooseX/Clone/Meta/Attribute/Trait/NoClone.pm
# once (470µs+1.11ms) by Devel::PartialDump::BEGIN@9 at line 9 of Devel/PartialDump.pm
# once (456µs+1.11ms) by KiokuDB::TypeMap::Resolver::BEGIN@11 at line 11 of KiokuDB/TypeMap/Resolver.pm
# once (445µs+1.12ms) by KiokuDB::Collapser::Buffer::BEGIN@7 at line 7 of KiokuDB/Collapser/Buffer.pm
# once (463µs+1.10ms) by MooseX::Clone::Meta::Attribute::Trait::Clone::Std::BEGIN@4 at line 4 of MooseX/Clone/Meta/Attribute/Trait/Clone/Std.pm
# once (477µs+1.05ms) by KiokuDB::TypeMap::Entry::Alias::BEGIN@6 at line 6 of KiokuDB/TypeMap/Entry/Alias.pm
# once (449µs+1.06ms) by KiokuDB::LiveObjects::TXNScope::BEGIN@8 at line 8 of KiokuDB/LiveObjects/TXNScope.pm
# once (447µs+1.06ms) by KiokuDB::TypeMap::Shadow::BEGIN@6 at line 6 of KiokuDB/TypeMap/Shadow.pm
# once (438µs+1.07ms) by KiokuDB::Stream::Objects::BEGIN@6 at line 6 of KiokuDB/Stream/Objects.pm
# once (436µs+1.07ms) by KiokuDB::LiveObjects::Scope::BEGIN@6 at line 6 of KiokuDB/LiveObjects/Scope.pm
# once (433µs+1.07ms) by KiokuDB::Reference::BEGIN@6 at line 6 of KiokuDB/Reference.pm
# once (438µs+1.06ms) by KiokuDB::Error::UnknownObjects::BEGIN@4 at line 4 of KiokuDB/Error/UnknownObjects.pm
# once (444µs+1.04ms) by Data::Stream::Bulk::Filter::BEGIN@14 at line 14 of Data/Stream/Bulk/Filter.pm
# once (438µs+1.03ms) by KiokuDB::Entry::Skip::BEGIN@6 at line 6 of KiokuDB/Entry/Skip.pm
# once (459µs+1.01ms) by Data::Stream::Bulk::Cat::BEGIN@12 at line 12 of Data/Stream/Bulk/Cat.pm
# once (424µs+1.02ms) by KiokuDB::TypeMap::Entry::Compiled::BEGIN@6 at line 6 of KiokuDB/TypeMap/Entry/Compiled.pm
# once (427µs+1.01ms) by KiokuDB::Error::MissingObjects::BEGIN@4 at line 4 of KiokuDB/Error/MissingObjects.pm
# once (429µs+1.01ms) by KiokuDB::Thunk::BEGIN@6 at line 6 of KiokuDB/Thunk.pm
# once (422µs+1.01ms) by Data::Stream::Bulk::Nil::BEGIN@12 at line 12 of Data/Stream/Bulk/Nil.pm
# once (218µs+411µs) by KiokuDB::LiveObjects::Guard::BEGIN@8 at line 8 of KiokuDB/LiveObjects/Guard.pm | ||||
| 68 | 230 | 1.17ms | my ($pragma, @args) = @_; | ||
| 69 | |||||
| 70 | my (%args, $is_explicit); | ||||
| 71 | |||||
| 72 | ARG: | ||||
| 73 | while (@args) { | ||||
| 74 | |||||
| 75 | 184 | 2.04ms | 46 | 485µs | if ($args[0] =~ /^\-/) { # spent 485µs making 46 calls to namespace::clean::CORE:match, avg 11µs/call |
| 76 | my $key = shift @args; | ||||
| 77 | my $value = shift @args; | ||||
| 78 | $args{ $key } = $value; | ||||
| 79 | } | ||||
| 80 | else { | ||||
| 81 | $is_explicit++; | ||||
| 82 | last ARG; | ||||
| 83 | } | ||||
| 84 | } | ||||
| 85 | |||||
| 86 | my $cleanee = exists $args{ -cleanee } ? $args{ -cleanee } : scalar caller; | ||||
| 87 | 322 | 6.29ms | if ($is_explicit) { | ||
| 88 | on_scope_end { | ||||
| 89 | $RemoveSubs->($cleanee, {}, @args); | ||||
| 90 | }; | ||||
| 91 | } | ||||
| 92 | else { | ||||
| 93 | |||||
| 94 | # calling class, all current functions and our storage | ||||
| 95 | 46 | 28.9ms | my $functions = $pragma->get_functions($cleanee); # spent 28.9ms making 46 calls to namespace::clean::get_functions, avg 629µs/call | ||
| 96 | 46 | 7.56ms | my $store = $pragma->get_class_store($cleanee); # spent 7.56ms making 46 calls to namespace::clean::get_class_store, avg 164µs/call | ||
| 97 | 46 | 558µs | my $stash = Package::Stash->new($cleanee); # spent 558µs making 46 calls to Package::Stash::XS::new, avg 12µs/call | ||
| 98 | |||||
| 99 | # except parameter can be array ref or single value | ||||
| 100 | my %except = map {( $_ => 1 )} ( | ||||
| 101 | $args{ -except } | ||||
| 102 | ? ( ref $args{ -except } eq 'ARRAY' ? @{ $args{ -except } } : $args{ -except } ) | ||||
| 103 | : () | ||||
| 104 | ); | ||||
| 105 | |||||
| 106 | # register symbols for removal, if they have a CODE entry | ||||
| 107 | for my $f (keys %$functions) { | ||||
| 108 | 2083 | 28.9ms | next if $except{ $f }; | ||
| 109 | 1358 | 17.6ms | next unless $stash->has_symbol("&$f"); # spent 14.9ms making 679 calls to Package::Stash::XS::has_symbol, avg 22µs/call
# spent 2.72ms making 679 calls to Package::Stash::XS::namespace, avg 4µs/call | ||
| 110 | $store->{remove}{ $f } = 1; | ||||
| 111 | } | ||||
| 112 | |||||
| 113 | # register EOF handler on first call to import | ||||
| 114 | 92 | 1.25ms | unless ($store->{handler_is_installed}) { | ||
| 115 | # spent 268ms (1.67+266) within namespace::clean::__ANON__[/home/doy/coding/src/namespace-clean/namespace-clean-0.18/blib/lib/namespace/clean.pm:117] which was called 46 times, avg 5.82ms/call:
# 46 times (1.67ms+266ms) by B::Hooks::EndOfScope::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/B/Hooks/EndOfScope.pm:26] at line 26 of B/Hooks/EndOfScope.pm, avg 5.82ms/call | ||||
| 116 | 46 | 1.67ms | 46 | 266ms | $RemoveSubs->($cleanee, $store, keys %{ $store->{remove} }); # spent 266ms making 46 calls to namespace::clean::__ANON__[namespace/clean.pm:59], avg 5.79ms/call |
| 117 | 46 | 4.28ms | }; # spent 4.28ms making 46 calls to B::Hooks::EndOfScope::on_scope_end, avg 93µs/call | ||
| 118 | $store->{handler_is_installed} = 1; | ||||
| 119 | } | ||||
| 120 | |||||
| 121 | return 1; | ||||
| 122 | } | ||||
| 123 | } | ||||
| 124 | |||||
| 125 | |||||
| 126 | sub unimport { | ||||
| 127 | my ($pragma, %args) = @_; | ||||
| 128 | |||||
| 129 | # the calling class, the current functions and our storage | ||||
| 130 | my $cleanee = exists $args{ -cleanee } ? $args{ -cleanee } : scalar caller; | ||||
| 131 | my $functions = $pragma->get_functions($cleanee); | ||||
| 132 | my $store = $pragma->get_class_store($cleanee); | ||||
| 133 | |||||
| 134 | # register all unknown previous functions as excluded | ||||
| 135 | for my $f (keys %$functions) { | ||||
| 136 | next if $store->{remove}{ $f } | ||||
| 137 | or $store->{exclude}{ $f }; | ||||
| 138 | $store->{exclude}{ $f } = 1; | ||||
| 139 | } | ||||
| 140 | |||||
| 141 | return 1; | ||||
| 142 | } | ||||
| 143 | |||||
| 144 | |||||
| 145 | # spent 7.56ms (3.14+4.42) within namespace::clean::get_class_store which was called 46 times, avg 164µs/call:
# 46 times (3.14ms+4.42ms) by namespace::clean::import at line 96, avg 164µs/call | ||||
| 146 | 230 | 7.59ms | my ($pragma, $class) = @_; | ||
| 147 | 46 | 587µs | my $stash = Package::Stash->new($class); # spent 587µs making 46 calls to Package::Stash::XS::new, avg 13µs/call | ||
| 148 | my $var = "%$STORAGE_VAR"; | ||||
| 149 | 184 | 3.16ms | $stash->add_symbol($var, {}) # spent 1.75ms making 46 calls to Package::Stash::XS::add_symbol, avg 38µs/call
# spent 1.04ms making 46 calls to Package::Stash::XS::has_symbol, avg 23µs/call
# spent 194µs making 46 calls to Package::Stash::XS::name, avg 4µs/call
# spent 183µs making 46 calls to Package::Stash::XS::namespace, avg 4µs/call | ||
| 150 | unless $stash->has_symbol($var); | ||||
| 151 | 92 | 1.23ms | return $stash->get_symbol($var); # spent 1.05ms making 46 calls to Package::Stash::XS::get_symbol, avg 23µs/call
# spent 181µs making 46 calls to Package::Stash::XS::namespace, avg 4µs/call | ||
| 152 | } | ||||
| 153 | |||||
| 154 | |||||
| 155 | # spent 28.9ms (10.3+18.6) within namespace::clean::get_functions which was called 46 times, avg 629µs/call:
# 46 times (10.3ms+18.6ms) by namespace::clean::import at line 95, avg 629µs/call | ||||
| 156 | 138 | 29.1ms | my ($pragma, $class) = @_; | ||
| 157 | |||||
| 158 | 46 | 969µs | my $stash = Package::Stash->new($class); # spent 969µs making 46 calls to Package::Stash::XS::new, avg 21µs/call | ||
| 159 | return { | ||||
| 160 | 1542 | 21.0ms | map { $_ => $stash->get_symbol("&$_") } # spent 15.6ms making 725 calls to Package::Stash::XS::get_symbol, avg 22µs/call
# spent 3.33ms making 771 calls to Package::Stash::XS::namespace, avg 4µs/call
# spent 2.05ms making 46 calls to Package::Stash::XS::list_all_symbols, avg 45µs/call | ||
| 161 | $stash->list_all_symbols('CODE') | ||||
| 162 | }; | ||||
| 163 | } | ||||
| 164 | |||||
| 165 | |||||
| 166 | 3 | 140µs | 2 | 253µs | # spent 160µs (68+92) within namespace::clean::BEGIN@166 which was called:
# once (68µs+92µs) by KiokuDB::Backend::BEGIN@9 at line 166 # spent 160µs making 1 call to namespace::clean::BEGIN@166
# spent 92µs making 1 call to warnings::unimport |
| 167 | 1 | 16µs | 'Danger! Laws of Thermodynamics may not apply.' | ||
| 168 | |||||
| 169 | __END__ | ||||
# spent 485µs within namespace::clean::CORE:match which was called 46 times, avg 11µs/call:
# 46 times (485µs+0s) by namespace::clean::import at line 75, avg 11µs/call |