Filename | /opt/perl-5.18.1/lib/5.18.1/Exporter.pm |
Statements | Executed 2637 statements in 7.25ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
174 | 170 | 82 | 6.50ms | 6.85ms | import | Exporter::
4 | 2 | 1 | 1.88ms | 1.96ms | as_heavy | Exporter::
307 | 2 | 1 | 223µs | 223µs | CORE:match (opcode) | Exporter::
455 | 2 | 1 | 140µs | 140µs | CORE:subst (opcode) | Exporter::
2 | 2 | 2 | 11µs | 1.95ms | export_to_level | Exporter::
2 | 1 | 1 | 9µs | 26µs | export | 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 | 11µs | require 5.006; | ||
4 | |||||
5 | # Be lean. | ||||
6 | #use strict; | ||||
7 | #no strict 'refs'; | ||||
8 | |||||
9 | 1 | 300ns | our $Debug = 0; | ||
10 | 1 | 100ns | our $ExportLevel = 0; | ||
11 | 1 | 200ns | our $Verbose ||= 0; | ||
12 | 1 | 400ns | our $VERSION = '5.68'; | ||
13 | 1 | 200ns | our (%Cache); | ||
14 | |||||
15 | sub as_heavy { | ||||
16 | 4 | 108µ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 | 4 | 11µs | my $c = (caller(1))[3]; | ||
20 | 4 | 24µs | 4 | 11µs | $c =~ s/.*:://; # spent 11µs making 4 calls to Exporter::CORE:subst, avg 3µs/call |
21 | 4 | 18µs | \&{"Exporter::Heavy::heavy_$c"}; | ||
22 | } | ||||
23 | |||||
24 | # spent 26µs (9+17) within Exporter::export which was called 2 times, avg 13µs/call:
# 2 times (9µs+17µs) by Exporter::Heavy::heavy_export_to_level at line 214 of Exporter/Heavy.pm, avg 13µs/call | ||||
25 | 2 | 10µs | 4 | 232µs | goto &{as_heavy()}; # spent 214µs making 2 calls to Exporter::Heavy::heavy_export, avg 107µs/call
# spent 17µs making 2 calls to Exporter::as_heavy, avg 9µs/call |
26 | } | ||||
27 | |||||
28 | # spent 6.85ms (6.50+351µs) within Exporter::import which was called 174 times, avg 39µs/call:
# 4 times (136µs+7µs) by Moose::Meta::Class::BEGIN@17 or Moose::Meta::TypeConstraint::Union::BEGIN@17 or Moose::Util::BEGIN@17 or Moose::Util::MetaRole::BEGIN@15 at line 36 of List/Util.pm, avg 36µs/call
# 2 times (61µs+2µs) by Class::MOP::Package::BEGIN@15 or Moose::Meta::Role::BEGIN@16 at line 38 of Sub/Exporter/Progressive.pm, avg 31µs/call
# once (638µs+105µs) by Moo::BEGIN@5 at line 5 of Moo.pm
# once (99µs+5µs) by Package::DeprecationManager::BEGIN@10 at line 10 of Package/DeprecationManager.pm
# once (82µs+5µs) by Moose::BEGIN@13 at line 13 of Moose.pm
# once (76µs+6µs) by Package::DeprecationManager::BEGIN@11 at line 11 of Package/DeprecationManager.pm
# once (74µs+3µs) by Method::Generate::Accessor::BEGIN@4 at line 4 of Method/Generate/Accessor.pm
# once (66µs+3µs) by Moo::BEGIN@4 at line 4 of Moo.pm
# once (65µs+3µs) by Sub::Defer::BEGIN@5 at line 5 of Sub/Defer.pm
# once (65µs+3µs) by Moo::HandleMoose::BEGIN@4 at line 4 of Moo/HandleMoose.pm
# once (50µs+4µs) by Method::Generate::Constructor::BEGIN@8 at line 8 of Method/Generate/Constructor.pm
# once (49µs+2µs) by main::BEGIN@6 at line 6 of fastest.pl
# once (47µs+3µs) by Moose::BEGIN@14 at line 14 of Moose.pm
# once (46µs+2µs) by Method::Generate::Constructor::BEGIN@4 at line 4 of Method/Generate/Constructor.pm
# once (47µs+2µs) by Class::MOP::Class::Immutable::Trait::BEGIN@14 at line 14 of Class/MOP/Class/Immutable/Trait.pm
# once (45µs+1µs) by Moose::Util::TypeConstraints::Builtins::BEGIN@14 at line 14 of Moose/Util/TypeConstraints/Builtins.pm
# once (44µs+2µs) by Class::MOP::Instance::BEGIN@13 at line 13 of Class/MOP/Instance.pm
# once (43µs+2µs) by Types::Standard::BEGIN@22 at line 22 of Types/Standard.pm
# once (44µs+2µs) by Moose::Exporter::BEGIN@14 at line 14 of Moose/Exporter.pm
# once (43µs+2µs) by Types::TypeTiny::BEGIN@9 at line 9 of Types/TypeTiny.pm
# once (43µs+2µs) by Moose::BEGIN@15 at line 15 of Moose.pm
# once (42µs+2µs) by Type::Tiny::BEGIN@17 at line 17 of Type/Tiny.pm
# once (42µs+2µs) by Class::MOP::BEGIN@19 at line 19 of Class/MOP.pm
# once (42µs+2µs) by Moose::Meta::Method::Constructor::BEGIN@15 at line 15 of Moose/Meta/Method/Constructor.pm
# once (41µs+2µs) by Moose::Meta::Attribute::BEGIN@14 at line 14 of Moose/Meta/Attribute.pm
# once (41µs+2µs) by Class::MOP::Method::Inlined::BEGIN@13 at line 13 of Class/MOP/Method/Inlined.pm
# once (41µs+1µs) by Class::MOP::Method::Constructor::BEGIN@15 at line 15 of Class/MOP/Method/Constructor.pm
# once (40µs+2µs) by Try::Tiny::BEGIN@17 at line 17 of Try/Tiny.pm
# once (40µs+2µs) by Foo::Moo::QS::BEGIN@130 at line 130 of fastest.pl
# once (40µs+1µs) by Moose::Meta::Method::Constructor::BEGIN@16 at line 16 of Moose/Meta/Method/Constructor.pm
# once (39µs+2µs) by Benchmark::BEGIN@432 at line 432 of Benchmark.pm
# once (39µs+2µs) by Typed::BEGIN@8 at line 8 of Typed.pm
# once (39µs+2µs) by Class::XSAccessor::Heavy::BEGIN@7 at line 7 of Class/XSAccessor/Heavy.pm
# once (39µs+2µs) by Eval::Closure::BEGIN@15 at line 15 of Eval/Closure.pm
# once (39µs+2µs) by Moose::Meta::Class::BEGIN@18 at line 18 of Moose/Meta/Class.pm
# once (39µs+2µs) by metaclass::BEGIN@16 at line 16 of metaclass.pm
# once (39µs+2µs) by Moose::Util::TypeConstraints::Builtins::BEGIN@12 at line 12 of Moose/Util/TypeConstraints/Builtins.pm
# once (39µs+2µs) by Sub::Install::BEGIN@9 at line 9 of Sub/Install.pm
# once (39µs+2µs) by Method::Generate::Accessor::BEGIN@6 at line 6 of Method/Generate/Accessor.pm
# once (39µs+2µs) by Foo::Manual::BEGIN@53 at line 53 of fastest.pl
# once (39µs+1µs) by Moose::Util::TypeConstraints::BEGIN@12 at line 12 of Moose/Util/TypeConstraints.pm
# once (38µs+2µs) by Module::Implementation::BEGIN@13 at line 13 of Module/Implementation.pm
# once (38µs+1µs) by Eval::Closure::BEGIN@18 at line 18 of Eval/Closure.pm
# once (38µs+1µs) by Class::MOP::Method::Accessor::BEGIN@14 at line 14 of Class/MOP/Method/Accessor.pm
# once (36µs+2µs) by Moose::Meta::Method::Accessor::BEGIN@13 at line 13 of Moose/Meta/Method/Accessor.pm
# once (37µs+1µs) by Class::Load::BEGIN@16 at line 16 of Class/Load.pm
# once (37µs+1µs) by Class::MOP::Method::BEGIN@14 at line 14 of Class/MOP/Method.pm
# once (36µs+2µs) by Type::Coercion::BEGIN@13 at line 13 of Type/Coercion.pm
# once (36µs+2µs) by Class::MOP::Package::BEGIN@13 at line 13 of Class/MOP/Package.pm
# once (36µs+1µs) by Class::MOP::Method::Accessor::BEGIN@15 at line 15 of Class/MOP/Method/Accessor.pm
# once (36µs+2µs) by Class::MOP::Mixin::HasMethods::BEGIN@15 at line 15 of Class/MOP/Mixin/HasMethods.pm
# once (36µs+1µs) by metaclass::BEGIN@13 at line 13 of metaclass.pm
# once (36µs+1µs) by Moose::Meta::Role::BEGIN@13 at line 13 of Moose/Meta/Role.pm
# once (36µs+2µs) by Moose::Util::TypeConstraints::BEGIN@11 at line 11 of Moose/Util/TypeConstraints.pm
# once (36µs+1µs) by Method::Generate::Constructor::BEGIN@6 at line 6 of Method/Generate/Constructor.pm
# once (35µs+2µs) by Class::Load::PP::BEGIN@10 at line 10 of Class/Load/PP.pm
# once (36µs+1µs) by Moose::Meta::Method::Delegation::BEGIN@13 at line 13 of Moose/Meta/Method/Delegation.pm
# once (36µs+1µs) by Class::MOP::Method::Accessor::BEGIN@13 at line 13 of Class/MOP/Method/Accessor.pm
# once (36µs+1µs) by Moose::Meta::Method::Destructor::BEGIN@15 at line 15 of Moose/Meta/Method/Destructor.pm
# once (36µs+1µs) by Moose::Meta::TypeConstraint::BEGIN@19 at line 19 of Moose/Meta/TypeConstraint.pm
# once (35µs+1µs) by Class::MOP::Attribute::BEGIN@17 at line 17 of Class/MOP/Attribute.pm
# once (35µs+1µs) by Data::OptList::BEGIN@10 at line 95 of Params/Util.pm
# once (35µs+1µs) by Class::Load::PP::BEGIN@11 at line 11 of Class/Load/PP.pm
# once (34µs+1µs) by Moose::Meta::Method::Destructor::BEGIN@14 at line 14 of Moose/Meta/Method/Destructor.pm
# once (34µs+1µs) by Moose::Meta::TypeConstraint::BEGIN@22 at line 22 of Moose/Meta/TypeConstraint.pm
# once (34µs+1µs) by Moose::Meta::Attribute::BEGIN@17 at line 17 of Moose/Meta/Attribute.pm
# once (34µs+2µs) by Class::MOP::Attribute::BEGIN@15 at line 15 of Class/MOP/Attribute.pm
# once (34µs+1µs) by Sub::Quote::BEGIN@7 at line 7 of Sub/Quote.pm
# once (34µs+1µs) by Moose::Util::BEGIN@20 at line 20 of Moose/Util.pm
# once (34µs+2µs) by Moose::Util::BEGIN@12 at line 12 of Moose/Util.pm
# once (33µs+2µs) by Class::MOP::Mixin::HasMethods::BEGIN@17 at line 17 of Class/MOP/Mixin/HasMethods.pm
# once (34µs+1µs) by Moose::Meta::Method::Constructor::BEGIN@14 at line 14 of Moose/Meta/Method/Constructor.pm
# once (34µs+1µs) by Class::MOP::Class::BEGIN@21 at line 21 of Class/MOP/Class.pm
# once (33µs+1µs) by Class::MOP::Class::Immutable::Trait::BEGIN@15 at line 15 of Class/MOP/Class/Immutable/Trait.pm
# once (33µs+2µs) by Class::MOP::BEGIN@21 at line 21 of Class/MOP.pm
# once (33µs+1µs) by Moose::Meta::TypeConstraint::BEGIN@24 at line 24 of Moose/Meta/TypeConstraint.pm
# once (33µs+2µs) by Moose::Meta::Role::Application::ToClass::BEGIN@15 at line 15 of Moose/Meta/Role/Application/ToClass.pm
# once (33µs+1µs) by Class::MOP::Method::Generated::BEGIN@14 at line 14 of Class/MOP/Method/Generated.pm
# once (32µs+1µs) by Moose::Meta::Role::Composite::BEGIN@13 at line 13 of Moose/Meta/Role/Composite.pm
# once (32µs+1µs) by Class::MOP::Attribute::BEGIN@16 at line 16 of Class/MOP/Attribute.pm
# once (32µs+1µs) by Moose::Meta::Attribute::BEGIN@15 at line 15 of Moose/Meta/Attribute.pm
# once (32µs+1µs) by Moose::Meta::Method::Delegation::BEGIN@14 at line 14 of Moose/Meta/Method/Delegation.pm
# once (32µs+1µs) by Class::MOP::Method::Constructor::BEGIN@14 at line 14 of Class/MOP/Method/Constructor.pm
# once (32µs+1µs) by Moose::Meta::Role::Attribute::BEGIN@12 at line 12 of Moose/Meta/Role/Attribute.pm
# once (31µs+1µs) by Type::Utils::BEGIN@14 at line 14 of Type/Utils.pm
# once (32µs+900ns) by Method::Generate::Accessor::BEGIN@7 at line 7 of Method/Generate/Accessor.pm
# once (31µs+1µs) by Class::MOP::Method::Meta::BEGIN@14 at line 14 of Class/MOP/Method/Meta.pm
# once (31µs+1µs) by Class::MOP::Class::BEGIN@23 at line 23 of Class/MOP/Class.pm
# once (31µs+900ns) by Moose::Meta::Class::BEGIN@19 at line 19 of Moose/Meta/Class.pm
# once (31µs+1µs) by Moose::Meta::Class::BEGIN@13 at line 13 of Moose/Meta/Class.pm
# once (31µs+1µs) by Moose::Meta::Class::Immutable::Trait::BEGIN@13 at line 13 of Moose/Meta/Class/Immutable/Trait.pm
# once (31µs+1µs) by Class::MOP::Method::Overload::BEGIN@13 at line 13 of Class/MOP/Method/Overload.pm
# once (30µs+1µs) by Class::MOP::Class::BEGIN@20 at line 20 of Class/MOP/Class.pm
# once (30µs+1µs) by Class::MOP::Class::BEGIN@19 at line 19 of Class/MOP/Class.pm
# once (30µs+1µs) by Moose::Meta::Role::Application::ToInstance::BEGIN@13 at line 13 of Moose/Meta/Role/Application/ToInstance.pm
# once (30µs+1µs) by Moose::Meta::TypeConstraint::Registry::BEGIN@14 at line 14 of Moose/Meta/TypeConstraint/Registry.pm
# once (31µs+1µs) by Type::Library::BEGIN@13 at line 13 of Type/Library.pm
# once (30µs+1µs) by Moose::Meta::Object::Trait::BEGIN@10 at line 10 of Moose/Meta/Object/Trait.pm
# once (30µs+1µs) by Class::MOP::Method::Wrapped::BEGIN@13 at line 13 of Class/MOP/Method/Wrapped.pm
# once (30µs+1µs) by Class::MOP::MiniTrait::BEGIN@12 at line 12 of Class/MOP/MiniTrait.pm
# once (30µs+1µs) by Class::XSAccessor::BEGIN@5 at line 5 of Class/XSAccessor.pm
# once (30µs+1µs) by Class::MOP::BEGIN@17 at line 17 of Class/MOP.pm
# once (30µs+900ns) by Class::MOP::Module::BEGIN@14 at line 14 of Class/MOP/Module.pm
# once (30µs+1µs) by Moose::Meta::TypeCoercion::Union::BEGIN@14 at line 14 of Moose/Meta/TypeCoercion/Union.pm
# once (30µs+1µs) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/Parameterized.pm
# once (30µs+1µs) by Moose::Meta::TypeConstraint::Union::BEGIN@16 at line 16 of Moose/Meta/TypeConstraint/Union.pm
# once (30µs+1µs) by Class::MOP::Method::Constructor::BEGIN@13 at line 13 of Class/MOP/Method/Constructor.pm
# once (30µs+1µs) by Moose::Meta::Role::Attribute::BEGIN@14 at line 14 of Moose/Meta/Role/Attribute.pm
# once (30µs+1µs) by Moose::Meta::Role::Application::ToClass::BEGIN@13 at line 13 of Moose/Meta/Role/Application/ToClass.pm
# once (29µs+1µs) by Class::MOP::Method::Meta::BEGIN@13 at line 13 of Class/MOP/Method/Meta.pm
# once (29µs+1µs) by Moose::Meta::Role::Application::ToRole::BEGIN@13 at line 13 of Moose/Meta/Role/Application/ToRole.pm
# once (29µs+1µs) by Class::MOP::Module::BEGIN@13 at line 13 of Class/MOP/Module.pm
# once (29µs+1µs) by Moose::Meta::Role::Application::RoleSummation::BEGIN@13 at line 13 of Moose/Meta/Role/Application/RoleSummation.pm
# once (29µs+1µs) by Class::MOP::Method::BEGIN@13 at line 13 of Class/MOP/Method.pm
# once (29µs+1µs) by Package::DeprecationManager::BEGIN@9 at line 9 of Package/DeprecationManager.pm
# once (29µs+1µs) by Moose::Exporter::BEGIN@16 at line 16 of Moose/Exporter.pm
# once (29µs+1µs) by Class::MOP::Mixin::HasAttributes::BEGIN@12 at line 12 of Class/MOP/Mixin/HasAttributes.pm
# once (29µs+1µs) by Class::MOP::Method::Generated::BEGIN@13 at line 13 of Class/MOP/Method/Generated.pm
# once (29µs+1µs) by Class::MOP::Mixin::AttributeCore::BEGIN@12 at line 12 of Class/MOP/Mixin/AttributeCore.pm
# once (28µs+1µs) by Moose::Meta::Attribute::Native::BEGIN@9 at line 9 of Moose/Meta/Attribute/Native.pm
# once (28µs+1µs) by Class::MOP::Object::BEGIN@13 at line 13 of Class/MOP/Object.pm
# once (28µs+1µs) by Try::Tiny::BEGIN@1 at line 1 of (eval 21)[Try/Tiny.pm:20]
# once (28µs+1µs) by Moose::Meta::TypeConstraint::Class::BEGIN@14 at line 14 of Moose/Meta/TypeConstraint/Class.pm
# once (28µs+1µs) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@17 at line 17 of Moose/Meta/TypeConstraint/Parameterizable.pm
# once (28µs+1µs) by Class::MOP::Mixin::BEGIN@12 at line 12 of Class/MOP/Mixin.pm
# once (28µs+1µs) by Moose::Exporter::BEGIN@12 at line 12 of Moose/Exporter.pm
# once (28µs+1µs) by Moose::Exporter::BEGIN@18 at line 18 of Moose/Exporter.pm
# once (28µs+1µs) by Moose::Meta::TypeConstraint::DuckType::BEGIN@14 at line 14 of Moose/Meta/TypeConstraint/DuckType.pm
# once (28µs+1µs) by Moose::Util::BEGIN@18 at line 18 of Moose/Util.pm
# once (28µs+1µs) by Class::MOP::Method::Inlined::BEGIN@12 at line 12 of Class/MOP/Method/Inlined.pm
# once (27µs+1µs) by Method::Generate::Constructor::BEGIN@7 at line 7 of Method/Generate/Constructor.pm
# once (27µs+1µs) by Moose::Meta::TypeConstraint::Role::BEGIN@14 at line 14 of Moose/Meta/TypeConstraint/Role.pm
# once (28µs+1µs) by Moose::Util::BEGIN@14 at line 14 of Moose/Util.pm
# once (28µs+1µs) by Moose::Util::BEGIN@16 at line 16 of Moose/Util.pm
# once (27µs+1µs) by Moose::Util::MetaRole::BEGIN@11 at line 11 of Moose/Util/MetaRole.pm
# once (27µs+1µs) by Moose::Meta::Role::Composite::BEGIN@14 at line 14 of Moose/Meta/Role/Composite.pm
# once (27µs+1µs) by Moose::Meta::Class::BEGIN@15 at line 15 of Moose/Meta/Class.pm
# once (27µs+1µs) by Moose::Meta::TypeConstraint::BEGIN@20 at line 20 of Moose/Meta/TypeConstraint.pm
# once (27µs+900ns) by Moose::Meta::Role::BEGIN@14 at line 14 of Moose/Meta/Role.pm
# once (27µs+1µs) by Method::Generate::Accessor::BEGIN@8 at line 8 of Method/Generate/Accessor.pm
# once (27µs+900ns) by Sub::Quote::BEGIN@8 at line 8 of Sub/Quote.pm
# once (26µs+1µs) by Moose::Meta::Role::Attribute::BEGIN@13 at line 13 of Moose/Meta/Role/Attribute.pm
# once (26µs+900ns) by Class::MOP::Mixin::HasMethods::BEGIN@16 at line 16 of Class/MOP/Mixin/HasMethods.pm
# once (26µs+800ns) by Sub::Defer::BEGIN@6 at line 6 of Sub/Defer.pm
# once (26µs+1µs) by Class::MOP::Object::BEGIN@14 at line 14 of Class/MOP/Object.pm
# once (26µs+1µs) by Eval::Closure::BEGIN@17 at line 17 of Eval/Closure.pm
# once (26µs+900ns) by Sub::Quote::BEGIN@9 at line 9 of Sub/Quote.pm
# once (26µs+900ns) by Moose::Meta::Role::BEGIN@15 at line 15 of Moose/Meta/Role.pm
# once (26µs+800ns) by Moose::Meta::Attribute::BEGIN@16 at line 16 of Moose/Meta/Attribute.pm
# once (26µs+1µs) by Class::MOP::Method::Wrapped::BEGIN@14 at line 14 of Class/MOP/Method/Wrapped.pm
# once (26µs+900ns) by Moose::Meta::TypeConstraint::BEGIN@21 at line 21 of Moose/Meta/TypeConstraint.pm
# once (26µs+1µs) by Moo::HandleMoose::BEGIN@5 at line 5 of Moo/HandleMoose.pm
# once (26µs+900ns) by metaclass::BEGIN@15 at line 15 of metaclass.pm
# once (25µs+1µs) by Class::MOP::Mixin::HasAttributes::BEGIN@13 at line 13 of Class/MOP/Mixin/HasAttributes.pm
# once (25µs+900ns) by Moose::Meta::Role::Application::ToInstance::BEGIN@14 at line 14 of Moose/Meta/Role/Application/ToInstance.pm
# once (25µs+1µs) by metaclass::BEGIN@14 at line 14 of metaclass.pm
# once (25µs+900ns) by Moose::Meta::TypeConstraint::BEGIN@23 at line 23 of Moose/Meta/TypeConstraint.pm
# once (24µs+900ns) by Moose::Util::MetaRole::BEGIN@13 at line 13 of Moose/Util/MetaRole.pm
# once (24µs+900ns) by Class::MOP::Package::BEGIN@14 at line 14 of Class/MOP/Package.pm
# once (24µs+900ns) by Moose::Util::MetaRole::BEGIN@17 at line 17 of Moose/Util/MetaRole.pm
# once (24µs+800ns) by Class::MOP::Class::BEGIN@24 at line 24 of Class/MOP/Class.pm
# once (24µs+800ns) by Class::MOP::Class::BEGIN@22 at line 22 of Class/MOP/Class.pm
# once (24µs+900ns) by Moose::Meta::TypeConstraint::DuckType::BEGIN@15 at line 15 of Moose/Meta/TypeConstraint/DuckType.pm
# once (24µs+0s) by Benchmark::BEGIN@433 at line 433 of Benchmark.pm
# once (24µs+800ns) by Moose::Util::MetaRole::BEGIN@14 at line 14 of Moose/Util/MetaRole.pm
# once (19µs+0s) by Moose::Meta::TypeConstraint::Class::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/Class.pm
# once (18µs+0s) by Moose::Meta::TypeConstraint::Role::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/Role.pm
# once (18µs+0s) by Moose::Meta::TypeConstraint::Enum::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/Enum.pm
# once (18µs+0s) by Moose::Meta::TypeConstraint::DuckType::BEGIN@13 at line 13 of Moose/Meta/TypeConstraint/DuckType.pm
# once (9µs+0s) by Eval::Closure::BEGIN@12 at line 12 of Eval/Closure.pm | ||||
29 | 174 | 81µs | my $pkg = shift; | ||
30 | 174 | 117µs | my $callpkg = caller($ExportLevel); | ||
31 | |||||
32 | 174 | 60µs | if ($pkg eq "Exporter" and @_ and $_[0] eq "import") { | ||
33 | 1 | 4µs | *{$callpkg."::import"} = \&import; | ||
34 | 1 | 11µs | return; | ||
35 | } | ||||
36 | |||||
37 | # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-( | ||||
38 | 173 | 287µ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 | 173 | 206µs | my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"}; | ||
42 | 173 | 88µs | return export $pkg, $callpkg, @_ | ||
43 | if $Verbose or $Debug or $fail && @$fail > 1; | ||||
44 | 173 | 110µs | my $export_cache = ($Cache{$pkg} ||= {}); | ||
45 | 173 | 117µs | my $args = @_ or @_ = @$exports; | ||
46 | |||||
47 | 173 | 53µs | if ($args and not %$export_cache) { | ||
48 | s/^&//, $export_cache->{$_} = 1 | ||||
49 | 10 | 970µs | 451 | 129µs | foreach (@$exports, @{"$pkg\::EXPORT_OK"}); # spent 129µs making 451 calls to Exporter::CORE:subst, avg 285ns/call |
50 | } | ||||
51 | 173 | 10µ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 | 173 | 108µ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 | 140 | 1.06ms | 203 | 175µs | foreach (@_); # spent 175µs making 203 calls to Exporter::CORE:match, avg 860ns/call |
58 | } else { | ||||
59 | ($heavy = /\W/) and last | ||||
60 | 33 | 296µs | 104 | 48µs | foreach (@_); # spent 48µs making 104 calls to Exporter::CORE:match, avg 462ns/call |
61 | } | ||||
62 | 173 | 19µs | return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy; | ||
63 | local $SIG{__WARN__} = | ||||
64 | 173 | 804µs | sub {require Carp; &Carp::carp} if not $SIG{__WARN__}; | ||
65 | # shortcut for the common case of no type character | ||||
66 | 173 | 2.65ms | *{"$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.95ms (11µs+1.94) within Exporter::export_to_level which was called 2 times, avg 977µs/call:
# once (7µs+1.93ms) by Time::HiRes::import at line 63 of Time/HiRes.pm
# once (4µs+13µs) by Benchmark::import at line 467 of Benchmark.pm | ||||
81 | 2 | 15µs | 4 | 2.21ms | goto &{as_heavy()}; # spent 1.94ms making 2 calls to Exporter::as_heavy, avg 972µs/call
# spent 265µs making 2 calls to Exporter::Heavy::heavy_export_to_level, avg 133µ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 | 5µs | 1; | ||
97 | __END__ | ||||
sub Exporter::CORE:match; # opcode | |||||
sub Exporter::CORE:subst; # opcode |