Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/5.18.0/Exporter.pm |
Statements | Executed 2723 statements in 4.78ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
178 | 175 | 81 | 4.13ms | 4.57ms | import | Exporter::
11 | 2 | 1 | 1.32ms | 1.39ms | as_heavy | Exporter::
312 | 2 | 1 | 136µs | 136µs | CORE:match (opcode) | Exporter::
264 | 2 | 1 | 47µs | 47µs | CORE:subst (opcode) | Exporter::
8 | 2 | 2 | 25µs | 84µs | export | Exporter::
3 | 2 | 2 | 10µs | 1.34ms | export_to_level | Exporter::
0 | 0 | 0 | 0s | 0s | __ANON__[:64] | Exporter::
0 | 0 | 0 | 0s | 0s | export_fail | Exporter::
0 | 0 | 0 | 0s | 0s | export_ok_tags | Exporter::
0 | 0 | 0 | 0s | 0s | export_tags | Exporter::
0 | 0 | 0 | 0s | 0s | require_version | Exporter::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Exporter; | ||||
2 | |||||
3 | 1 | 7µs | require 5.006; | ||
4 | |||||
5 | # Be lean. | ||||
6 | #use strict; | ||||
7 | #no strict 'refs'; | ||||
8 | |||||
9 | 1 | 200ns | our $Debug = 0; | ||
10 | 1 | 0s | our $ExportLevel = 0; | ||
11 | 1 | 100ns | our $Verbose ||= 0; | ||
12 | 1 | 200ns | our $VERSION = '5.68'; | ||
13 | 1 | 100ns | our (%Cache); | ||
14 | |||||
15 | sub as_heavy { | ||||
16 | 11 | 68µs | require Exporter::Heavy; | ||
17 | # Unfortunately, this does not work if the caller is aliased as *name = \&foo | ||||
18 | # Thus the need to create a lot of identical subroutines | ||||
19 | 11 | 22µs | my $c = (caller(1))[3]; | ||
20 | 11 | 38µs | 11 | 19µs | $c =~ s/.*:://; # spent 19µs making 11 calls to Exporter::CORE:subst, avg 2µs/call |
21 | 11 | 30µs | \&{"Exporter::Heavy::heavy_$c"}; | ||
22 | } | ||||
23 | |||||
24 | # spent 84µs (25+59) within Exporter::export which was called 8 times, avg 10µs/call:
# 5 times (17µs+41µs) by Exporter::import at line 62, avg 12µs/call
# 3 times (9µs+17µs) by Exporter::Heavy::heavy_export_to_level at line 214 of Exporter/Heavy.pm, avg 9µs/call | ||||
25 | 8 | 27µs | 16 | 453µs | goto &{as_heavy()}; # spent 394µs making 8 calls to Exporter::Heavy::heavy_export, avg 49µs/call
# spent 59µs making 8 calls to Exporter::as_heavy, avg 7µs/call |
26 | } | ||||
27 | |||||
28 | # spent 4.57ms (4.13+444µs) within Exporter::import which was called 178 times, avg 26µs/call:
# 4 times (91µs+3µs) by Class::MOP::Package::BEGIN@15 or Moose::Meta::Role::BEGIN@16 or namespace::autoclean::BEGIN@14 or namespace::clean::BEGIN@11 at line 38 of Sub/Exporter/Progressive.pm, avg 24µs/call
# once (192µs+17µs) by IO::Seekable::BEGIN@104 at line 104 of IO/Seekable.pm
# once (32µs+96µs) by Atom::BEGIN@8 at line 8 of lib/HackaMol/Atom.pm
# once (105µs+4µs) by Modern::Perl::BEGIN@16 at line 147 of IO/File.pm
# once (14µs+79µs) by Storable::BEGIN@52 at line 53 of Storable.pm
# once (61µs+3µs) by Package::DeprecationManager::BEGIN@10 at line 10 of Package/DeprecationManager.pm
# once (13µs+40µs) by Atom::BEGIN@93 at line 93 of lib/HackaMol/Atom.pm
# once (49µs+2µs) by Package::DeprecationManager::BEGIN@11 at line 11 of Package/DeprecationManager.pm
# once (12µs+36µs) by Atom::BEGIN@100 at line 100 of lib/HackaMol/Atom.pm
# once (46µs+1µs) by Class::MOP::Class::Immutable::Trait::BEGIN@14 at line 14 of Class/MOP/Class/Immutable/Trait.pm
# once (11µs+36µs) by Atom::BEGIN@106 at line 106 of lib/HackaMol/Atom.pm
# once (43µs+2µs) by Data::Dumper::BEGIN@22 at line 22 of Data/Dumper.pm
# once (39µs+2µs) by Moose::BEGIN@13 at line 13 of Moose.pm
# once (36µs+1µs) by IO::File::BEGIN@130 at line 130 of IO/File.pm
# once (34µs+900ns) by Class::MOP::Method::Accessor::BEGIN@15 at line 15 of Class/MOP/Method/Accessor.pm
# once (32µs+2µs) by Sub::Exporter::Progressive::BEGIN@9 at line 9 of Sub/Exporter/Progressive.pm
# once (31µs+2µs) by Moose::BEGIN@14 at line 14 of Moose.pm
# once (31µs+1µs) by Moose::Meta::Method::Constructor::BEGIN@15 at line 15 of Moose/Meta/Method/Constructor.pm
# once (31µs+1µs) by IO::File::BEGIN@131 at line 131 of IO/File.pm
# once (30µs+1µs) by Benchmark::BEGIN@432 at line 432 of Benchmark.pm
# once (30µs+1µs) by Class::MOP::Method::Inlined::BEGIN@13 at line 13 of Class/MOP/Method/Inlined.pm
# once (29µs+1µs) by Moose::BEGIN@15 at line 15 of Moose.pm
# once (29µs+800ns) by metaclass::BEGIN@13 at line 13 of metaclass.pm
# once (29µs+1µs) by Atom::BEGIN@5 at line 5 of lib/HackaMol/Atom.pm
# once (29µs+1µs) by Eval::Closure::BEGIN@15 at line 15 of Eval/Closure.pm
# once (28µs+900ns) by Moose::Meta::Method::Accessor::Native::Writer::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native/Writer.pm
# once (28µs+1µs) by Class::MOP::BEGIN@19 at line 19 of Class/MOP.pm
# once (28µs+1µs) by Class::MOP::Package::BEGIN@13 at line 13 of Class/MOP/Package.pm
# once (28µs+1µs) by Moose::Exporter::BEGIN@14 at line 14 of Moose/Exporter.pm
# once (28µs+700ns) by Moose::Util::TypeConstraints::BEGIN@12 at line 12 of Moose/Util/TypeConstraints.pm
# once (27µs+1µs) by Try::Tiny::BEGIN@17 at line 17 of Try/Tiny.pm
# once (26µs+1µs) by PhysVecRole::BEGIN@4 at line 4 of lib/roles/PhysVecRole.pm
# once (26µs+900ns) by Moose::Meta::Class::BEGIN@18 at line 18 of Moose/Meta/Class.pm
# once (26µs+1µs) by Sub::Install::BEGIN@6 at line 6 of Sub/Install.pm
# once (26µs+1000ns) by Moose::Meta::Method::Accessor::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor.pm
# once (26µs+1000ns) by SelectSaver::BEGIN@38 at line 38 of SelectSaver.pm
# once (26µs+1µs) by IO::Seekable::BEGIN@98 at line 98 of IO/Seekable.pm
# once (26µs+1µs) by Module::Implementation::BEGIN@13 at line 13 of Module/Implementation.pm
# once (26µs+1µs) by Class::MOP::Instance::BEGIN@13 at line 13 of Class/MOP/Instance.pm
# once (26µs+1µs) by Moose::Util::TypeConstraints::Builtins::BEGIN@14 at line 14 of Moose/Util/TypeConstraints/Builtins.pm
# once (26µs+900ns) by IO::Handle::BEGIN@267 at line 267 of IO/Handle.pm
# once (26µs+1µs) by IO::Handle::BEGIN@266 at line 266 of IO/Handle.pm
# once (26µs+1µs) by IO::File::BEGIN@133 at line 133 of IO/File.pm
# once (25µs+900ns) by Class::MOP::Method::Constructor::BEGIN@15 at line 15 of Class/MOP/Method/Constructor.pm
# once (25µs+800ns) by Moose::Meta::Method::Destructor::BEGIN@15 at line 15 of Moose/Meta/Method/Destructor.pm
# once (25µs+900ns) by Class::MOP::Attribute::BEGIN@17 at line 17 of Class/MOP/Attribute.pm
# once (25µs+1µs) by Moose::Meta::Attribute::BEGIN@14 at line 14 of Moose/Meta/Attribute.pm
# once (25µs+1µs) by SelectSaver::BEGIN@39 at line 39 of SelectSaver.pm
# once (24µs+2µs) by Class::MOP::Attribute::BEGIN@15 at line 15 of Class/MOP/Attribute.pm
# once (24µs+1µs) by Moose::Meta::Method::Constructor::BEGIN@16 at line 16 of Moose/Meta/Method/Constructor.pm
# once (24µs+900ns) by Class::MOP::Class::BEGIN@21 at line 21 of Class/MOP/Class.pm
# once (24µs+900ns) by Class::Load::BEGIN@16 at line 16 of Class/Load.pm
# once (24µs+900ns) by IO::BEGIN@6 at line 6 of IO.pm
# once (24µs+900ns) by Class::MOP::Class::Immutable::Trait::BEGIN@15 at line 15 of Class/MOP/Class/Immutable/Trait.pm
# once (24µs+800ns) by Class::MOP::Attribute::BEGIN@16 at line 16 of Class/MOP/Attribute.pm
# once (24µs+700ns) by Moose::Meta::Object::Trait::BEGIN@10 at line 10 of Moose/Meta/Object/Trait.pm
# once (24µs+900ns) by Class::MOP::Mixin::HasMethods::BEGIN@15 at line 15 of Class/MOP/Mixin/HasMethods.pm
# once (24µs+800ns) by Package::DeprecationManager::BEGIN@9 at line 9 of Package/DeprecationManager.pm
# once (24µs+800ns) by Moose::Meta::Role::BEGIN@13 at line 13 of Moose/Meta/Role.pm
# once (23µs+1µs) by Moose::Util::BEGIN@12 at line 12 of Moose/Util.pm
# once (23µs+900ns) by Moose::Meta::Role::Application::ToClass::BEGIN@15 at line 15 of Moose/Meta/Role/Application/ToClass.pm
# once (23µs+900ns) by Class::MOP::Method::BEGIN@14 at line 14 of Class/MOP/Method.pm
# once (23µs+900ns) by Moose::Util::TypeConstraints::BEGIN@11 at line 11 of Moose/Util/TypeConstraints.pm
# once (23µs+800ns) by Class::MOP::Method::Accessor::BEGIN@14 at line 14 of Class/MOP/Method/Accessor.pm
# once (23µs+800ns) by Class::MOP::Method::Generated::BEGIN@14 at line 14 of Class/MOP/Method/Generated.pm
# once (22µs+800ns) by Moose::Meta::Method::Constructor::BEGIN@14 at line 14 of Moose/Meta/Method/Constructor.pm
# once (22µs+900ns) by Class::MOP::Method::Constructor::BEGIN@14 at line 14 of Class/MOP/Method/Constructor.pm
# once (22µs+800ns) by Moose::Meta::Method::Accessor::Native::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor/Native.pm
# once (22µs+800ns) by Moose::Meta::Attribute::BEGIN@17 at line 17 of Moose/Meta/Attribute.pm
# once (22µs+800ns) by Class::MOP::BEGIN@21 at line 21 of Class/MOP.pm
# once (22µs+800ns) by Class::MOP::Class::BEGIN@23 at line 23 of Class/MOP/Class.pm
# once (22µs+800ns) by Class::MOP::Method::Constructor::BEGIN@13 at line 13 of Class/MOP/Method/Constructor.pm
# once (22µs+800ns) by metaclass::BEGIN@16 at line 16 of metaclass.pm
# once (22µs+700ns) by Moose::Meta::Attribute::BEGIN@15 at line 15 of Moose/Meta/Attribute.pm
# once (22µs+700ns) by Moose::Meta::Method::Accessor::Native::BEGIN@12 at line 12 of Moose/Meta/Method/Accessor/Native.pm
# once (22µs+900ns) by Moose::Meta::Method::Destructor::BEGIN@14 at line 14 of Moose/Meta/Method/Destructor.pm
# once (22µs+800ns) by Eval::Closure::BEGIN@18 at line 18 of Eval/Closure.pm
# once (22µs+900ns) by Moose::Util::TypeConstraints::Builtins::BEGIN@12 at line 12 of Moose/Util/TypeConstraints/Builtins.pm
# once (22µs+800ns) by Class::MOP::MiniTrait::BEGIN@12 at line 12 of Class/MOP/MiniTrait.pm
# once (21µs+900ns) by Moose::Meta::Attribute::Native::Trait::BEGIN@11 at line 11 of Moose/Meta/Attribute/Native/Trait.pm
# once (22µs+700ns) by Class::MOP::Method::Generated::BEGIN@13 at line 13 of Class/MOP/Method/Generated.pm
# once (21µs+800ns) by Data::OptList::BEGIN@10 at line 95 of Params/Util.pm
# once (21µs+800ns) by Class::MOP::Class::BEGIN@20 at line 20 of Class/MOP/Class.pm
# once (21µs+800ns) by Moose::Util::BEGIN@20 at line 20 of Moose/Util.pm
# once (21µs+800ns) by Moose::Meta::TypeConstraint::BEGIN@24 at line 24 of Moose/Meta/TypeConstraint.pm
# once (21µs+800ns) by Moose::Meta::Method::Delegation::BEGIN@14 at line 14 of Moose/Meta/Method/Delegation.pm
# once (21µs+1µs) by Class::MOP::Mixin::HasMethods::BEGIN@17 at line 17 of Class/MOP/Mixin/HasMethods.pm
# once (21µs+800ns) by Moose::Meta::Attribute::Native::Trait::BEGIN@12 at line 12 of Moose/Meta/Attribute/Native/Trait.pm
# once (21µs+700ns) by Class::MOP::Class::BEGIN@19 at line 19 of Class/MOP/Class.pm
# once (21µs+700ns) by Moose::Meta::TypeConstraint::BEGIN@22 at line 22 of Moose/Meta/TypeConstraint.pm
# once (21µs+800ns) by Moose::Meta::Class::BEGIN@13 at line 13 of Moose/Meta/Class.pm
# once (20µs+700ns) by Class::MOP::Method::Meta::BEGIN@14 at line 14 of Class/MOP/Method/Meta.pm
# once (20µs+700ns) by Moose::Meta::Role::Application::ToClass::BEGIN@13 at line 13 of Moose/Meta/Role/Application/ToClass.pm
# once (20µs+700ns) by Class::MOP::BEGIN@17 at line 17 of Class/MOP.pm
# once (20µs+800ns) by Moose::Meta::Class::Immutable::Trait::BEGIN@13 at line 13 of Moose/Meta/Class/Immutable/Trait.pm
# once (20µs+700ns) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/Parameterized.pm
# once (20µs+700ns) by Class::MOP::Method::Wrapped::BEGIN@13 at line 13 of Class/MOP/Method/Wrapped.pm
# once (20µs+700ns) by Moose::Meta::Method::Delegation::BEGIN@13 at line 13 of Moose/Meta/Method/Delegation.pm
# once (20µs+700ns) by Class::MOP::Method::Overload::BEGIN@13 at line 13 of Class/MOP/Method/Overload.pm
# once (20µs+700ns) by Class::MOP::Method::Inlined::BEGIN@12 at line 12 of Class/MOP/Method/Inlined.pm
# once (20µs+800ns) by Class::MOP::Method::Accessor::BEGIN@13 at line 13 of Class/MOP/Method/Accessor.pm
# once (20µs+800ns) by Moose::Meta::Role::Composite::BEGIN@13 at line 13 of Moose/Meta/Role/Composite.pm
# once (20µs+700ns) by Moose::Role::BEGIN@11 at line 11 of Moose/Role.pm
# once (20µs+700ns) by Moose::Meta::Role::Application::ToInstance::BEGIN@13 at line 13 of Moose/Meta/Role/Application/ToInstance.pm
# once (20µs+700ns) by Moose::Meta::Role::Application::ToRole::BEGIN@13 at line 13 of Moose/Meta/Role/Application/ToRole.pm
# once (20µs+700ns) by Moose::Meta::TypeConstraint::Registry::BEGIN@14 at line 14 of Moose/Meta/TypeConstraint/Registry.pm
# once (20µs+700ns) by Moose::Util::BEGIN@18 at line 18 of Moose/Util.pm
# once (19µs+700ns) by Moose::Meta::TypeCoercion::Union::BEGIN@14 at line 14 of Moose/Meta/TypeCoercion/Union.pm
# once (19µs+700ns) by Moose::Exporter::BEGIN@16 at line 16 of Moose/Exporter.pm
# once (19µs+600ns) by Moose::Meta::TypeConstraint::Union::BEGIN@16 at line 16 of Moose/Meta/TypeConstraint/Union.pm
# once (20µs+500ns) by Class::MOP::Module::BEGIN@14 at line 14 of Class/MOP/Module.pm
# once (19µs+700ns) by Class::MOP::Mixin::HasAttributes::BEGIN@12 at line 12 of Class/MOP/Mixin/HasAttributes.pm
# once (19µs+700ns) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@17 at line 17 of Moose/Meta/TypeConstraint/Parameterizable.pm
# once (19µs+800ns) by Moose::Exporter::BEGIN@12 at line 12 of Moose/Exporter.pm
# once (19µs+700ns) by Moose::Meta::Role::Attribute::BEGIN@14 at line 14 of Moose/Meta/Role/Attribute.pm
# once (19µs+700ns) by Moose::Meta::Role::Application::RoleSummation::BEGIN@13 at line 13 of Moose/Meta/Role/Application/RoleSummation.pm
# once (19µs+700ns) by Class::MOP::Method::Meta::BEGIN@13 at line 13 of Class/MOP/Method/Meta.pm
# once (19µs+700ns) by Moose::Exporter::BEGIN@18 at line 18 of Moose/Exporter.pm
# once (19µs+700ns) by Moose::Util::MetaRole::BEGIN@11 at line 11 of Moose/Util/MetaRole.pm
# once (19µs+800ns) by Moose::Meta::Method::Accessor::Native::Array::BEGIN@14 at line 14 of Moose/Meta/Method/Accessor/Native/Array.pm
# once (19µs+800ns) by Moose::Meta::Attribute::Native::BEGIN@9 at line 9 of Moose/Meta/Attribute/Native.pm
# once (19µs+700ns) by MooseX::Storage::Engine::BEGIN@9 at line 9 of MooseX/Storage/Engine.pm
# once (19µs+700ns) by Moose::Meta::TypeConstraint::DuckType::BEGIN@14 at line 14 of Moose/Meta/TypeConstraint/DuckType.pm
# once (19µs+700ns) by Class::MOP::Module::BEGIN@13 at line 13 of Class/MOP/Module.pm
# once (18µs+700ns) by Class::MOP::Method::BEGIN@13 at line 13 of Class/MOP/Method.pm
# once (18µs+700ns) by namespace::autoclean::BEGIN@15 at line 15 of namespace/autoclean.pm
# once (18µs+600ns) by Moose::Util::BEGIN@14 at line 14 of Moose/Util.pm
# once (18µs+700ns) by Moose::Meta::TypeConstraint::Class::BEGIN@14 at line 14 of Moose/Meta/TypeConstraint/Class.pm
# once (18µs+600ns) by Moose::Meta::Role::Attribute::BEGIN@12 at line 12 of Moose/Meta/Role/Attribute.pm
# once (18µs+600ns) by Class::MOP::Mixin::AttributeCore::BEGIN@12 at line 12 of Class/MOP/Mixin/AttributeCore.pm
# once (18µs+700ns) by Moose::Meta::TypeConstraint::BEGIN@19 at line 19 of Moose/Meta/TypeConstraint.pm
# once (18µs+500ns) by Moose::Meta::Role::BEGIN@15 at line 15 of Moose/Meta/Role.pm
# once (18µs+700ns) by Class::MOP::Mixin::BEGIN@12 at line 12 of Class/MOP/Mixin.pm
# once (18µs+700ns) by Moose::Meta::TypeConstraint::Role::BEGIN@14 at line 14 of Moose/Meta/TypeConstraint/Role.pm
# once (18µs+700ns) by Sub::Exporter::Progressive::BEGIN@8 at line 8 of Sub/Exporter/Progressive.pm
# once (18µs+700ns) by Try::Tiny::BEGIN@1 at line 1 of (eval 25)[Try/Tiny.pm:20]
# once (18µs+600ns) by Moose::Meta::Class::BEGIN@15 at line 15 of Moose/Meta/Class.pm
# once (18µs+600ns) by Class::MOP::Object::BEGIN@13 at line 13 of Class/MOP/Object.pm
# once (18µs+600ns) by Moose::Util::BEGIN@16 at line 16 of Moose/Util.pm
# once (18µs+500ns) by Moose::Meta::Attribute::BEGIN@16 at line 16 of Moose/Meta/Attribute.pm
# once (18µs+600ns) by Moose::Meta::Role::BEGIN@14 at line 14 of Moose/Meta/Role.pm
# once (17µs+600ns) by Eval::Closure::BEGIN@17 at line 17 of Eval/Closure.pm
# once (17µs+500ns) by Moose::Util::MetaRole::BEGIN@13 at line 13 of Moose/Util/MetaRole.pm
# once (17µs+500ns) by Class::MOP::Mixin::HasMethods::BEGIN@16 at line 16 of Class/MOP/Mixin/HasMethods.pm
# once (17µs+500ns) by Class::MOP::Class::BEGIN@22 at line 22 of Class/MOP/Class.pm
# once (17µs+600ns) by Moose::Meta::TypeConstraint::BEGIN@20 at line 20 of Moose/Meta/TypeConstraint.pm
# once (17µs+500ns) by Moose::Meta::TypeConstraint::Union::BEGIN@17 at line 17 of Moose/Meta/TypeConstraint/Union.pm
# once (17µs+500ns) by Class::MOP::Method::Wrapped::BEGIN@14 at line 14 of Class/MOP/Method/Wrapped.pm
# once (17µs+600ns) by Moose::Meta::Role::Composite::BEGIN@14 at line 14 of Moose/Meta/Role/Composite.pm
# once (17µs+500ns) by metaclass::BEGIN@14 at line 14 of metaclass.pm
# once (17µs+600ns) by Moose::Meta::Role::Application::ToInstance::BEGIN@14 at line 14 of Moose/Meta/Role/Application/ToInstance.pm
# once (17µs+600ns) by Moose::Role::BEGIN@12 at line 12 of Moose/Role.pm
# once (17µs+500ns) by Moose::Meta::TypeConstraint::BEGIN@21 at line 21 of Moose/Meta/TypeConstraint.pm
# once (17µs+500ns) by Moose::Meta::Class::BEGIN@19 at line 19 of Moose/Meta/Class.pm
# once (17µs+500ns) by Class::MOP::Class::BEGIN@24 at line 24 of Class/MOP/Class.pm
# once (17µs+500ns) by metaclass::BEGIN@15 at line 15 of metaclass.pm
# once (17µs+500ns) by Moose::Role::BEGIN@13 at line 13 of Moose/Role.pm
# once (17µs+500ns) by Class::MOP::Mixin::HasAttributes::BEGIN@13 at line 13 of Class/MOP/Mixin/HasAttributes.pm
# once (16µs+600ns) by Moose::Meta::Class::BEGIN@17 at line 17 of Moose/Meta/Class.pm
# once (17µs+500ns) by Class::MOP::Package::BEGIN@14 at line 14 of Class/MOP/Package.pm
# once (16µs+600ns) by Moose::Meta::TypeConstraint::DuckType::BEGIN@15 at line 15 of Moose/Meta/TypeConstraint/DuckType.pm
# once (16µs+500ns) by Moose::Meta::Role::Attribute::BEGIN@13 at line 13 of Moose/Meta/Role/Attribute.pm
# once (16µs+500ns) by Moose::Util::BEGIN@17 at line 17 of Moose/Util.pm
# once (16µs+500ns) by Moose::Util::MetaRole::BEGIN@14 at line 14 of Moose/Util/MetaRole.pm
# once (16µs+500ns) by Class::MOP::Object::BEGIN@14 at line 14 of Class/MOP/Object.pm
# once (16µs+500ns) by Moose::Meta::TypeConstraint::BEGIN@23 at line 23 of Moose/Meta/TypeConstraint.pm
# once (16µs+500ns) by Moose::Util::MetaRole::BEGIN@15 at line 15 of Moose/Util/MetaRole.pm
# once (16µs+0s) by Moose::Meta::TypeConstraint::Class::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/Class.pm
# once (15µs+500ns) by Moose::Util::MetaRole::BEGIN@17 at line 17 of Moose/Util/MetaRole.pm
# once (15µs+0s) by Class::Load::XS::BEGIN@9 at line 9 of Class/Load/XS.pm
# once (13µs+0s) by Moose::Meta::TypeConstraint::Enum::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/Enum.pm
# once (12µs+0s) by Benchmark::BEGIN@433 at line 433 of Benchmark.pm
# once (12µs+0s) by Moose::Meta::TypeConstraint::DuckType::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/DuckType.pm
# once (12µs+0s) by Moose::Meta::TypeConstraint::Role::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/Role.pm
# once (6µs+0s) by Eval::Closure::BEGIN@12 at line 12 of Eval/Closure.pm | ||||
29 | 178 | 48µs | my $pkg = shift; | ||
30 | 178 | 70µs | my $callpkg = caller($ExportLevel); | ||
31 | |||||
32 | 178 | 34µs | if ($pkg eq "Exporter" and @_ and $_[0] eq "import") { | ||
33 | 1 | 3µs | *{$callpkg."::import"} = \&import; | ||
34 | 1 | 3µs | return; | ||
35 | } | ||||
36 | |||||
37 | # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-( | ||||
38 | 177 | 184µs | my $exports = \@{"$pkg\::EXPORT"}; | ||
39 | # But, avoid creating things if they don't exist, which saves a couple of | ||||
40 | # hundred bytes per package processed. | ||||
41 | 177 | 132µs | my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"}; | ||
42 | 177 | 51µs | return export $pkg, $callpkg, @_ | ||
43 | if $Verbose or $Debug or $fail && @$fail > 1; | ||||
44 | 177 | 65µs | my $export_cache = ($Cache{$pkg} ||= {}); | ||
45 | 177 | 68µs | my $args = @_ or @_ = @$exports; | ||
46 | |||||
47 | 177 | 31µs | if ($args and not %$export_cache) { | ||
48 | s/^&//, $export_cache->{$_} = 1 | ||||
49 | 11 | 317µs | 253 | 28µs | foreach (@$exports, @{"$pkg\::EXPORT_OK"}); # spent 28µs making 253 calls to Exporter::CORE:subst, avg 112ns/call |
50 | } | ||||
51 | 177 | 1µs | my $heavy; | ||
52 | # Try very hard not to use {} and hence have to enter scope on the foreach | ||||
53 | # We bomb out of the loop with last as soon as heavy is set. | ||||
54 | 177 | 59µs | if ($args or $fail) { | ||
55 | ($heavy = (/\W/ or $args and not exists $export_cache->{$_} | ||||
56 | or $fail and @$fail and $_ eq $fail->[0])) and last | ||||
57 | 148 | 759µs | 248 | 116µs | foreach (@_); # spent 116µs making 248 calls to Exporter::CORE:match, avg 469ns/call |
58 | } else { | ||||
59 | ($heavy = /\W/) and last | ||||
60 | 29 | 137µs | 64 | 20µs | foreach (@_); # spent 20µs making 64 calls to Exporter::CORE:match, avg 312ns/call |
61 | } | ||||
62 | 177 | 30µs | 5 | 58µs | return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy; # spent 58µs making 5 calls to Exporter::export, avg 12µs/call |
63 | local $SIG{__WARN__} = | ||||
64 | 172 | 545µs | sub {require Carp; &Carp::carp} if not $SIG{__WARN__}; | ||
65 | # shortcut for the common case of no type character | ||||
66 | 172 | 2.03ms | *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_; | ||
67 | } | ||||
68 | |||||
69 | # Default methods | ||||
70 | |||||
71 | sub export_fail { | ||||
72 | my $self = shift; | ||||
73 | @_; | ||||
74 | } | ||||
75 | |||||
76 | # Unfortunately, caller(1)[3] "does not work" if the caller is aliased as | ||||
77 | # *name = \&foo. Thus the need to create a lot of identical subroutines | ||||
78 | # Otherwise we could have aliased them to export(). | ||||
79 | |||||
80 | # spent 1.34ms (10µs+1.33) within Exporter::export_to_level which was called 3 times, avg 446µs/call:
# 2 times (7µs+1.32ms) by Time::HiRes::import at line 63 of Time/HiRes.pm, avg 663µs/call
# once (3µs+8µs) by Benchmark::import at line 467 of Benchmark.pm | ||||
81 | 3 | 14µs | 6 | 1.55ms | goto &{as_heavy()}; # spent 1.33ms making 3 calls to Exporter::as_heavy, avg 443µs/call
# spent 222µs making 3 calls to Exporter::Heavy::heavy_export_to_level, avg 74µs/call |
82 | } | ||||
83 | |||||
84 | sub export_tags { | ||||
85 | goto &{as_heavy()}; | ||||
86 | } | ||||
87 | |||||
88 | sub export_ok_tags { | ||||
89 | goto &{as_heavy()}; | ||||
90 | } | ||||
91 | |||||
92 | sub require_version { | ||||
93 | goto &{as_heavy()}; | ||||
94 | } | ||||
95 | |||||
96 | 1 | 4µs | 1; | ||
97 | __END__ | ||||
sub Exporter::CORE:match; # opcode | |||||
sub Exporter::CORE:subst; # opcode |