← Index
NYTProf Performance Profile   « line view »
For fastest.pl
  Run on Fri Jan 31 20:48:16 2014
Reported on Fri Jan 31 20:49:40 2014

Filename/opt/perl-5.18.1/lib/5.18.1/Exporter.pm
StatementsExecuted 2637 statements in 7.25ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
174170826.50ms6.85msExporter::::importExporter::import
4211.88ms1.96msExporter::::as_heavyExporter::as_heavy
30721223µs223µsExporter::::CORE:matchExporter::CORE:match (opcode)
45521140µs140µsExporter::::CORE:substExporter::CORE:subst (opcode)
22211µs1.95msExporter::::export_to_levelExporter::export_to_level
2119µs26µsExporter::::exportExporter::export
0000s0sExporter::::__ANON__[:64]Exporter::__ANON__[:64]
0000s0sExporter::::export_failExporter::export_fail
0000s0sExporter::::export_ok_tagsExporter::export_ok_tags
0000s0sExporter::::export_tagsExporter::export_tags
0000s0sExporter::::require_versionExporter::require_version
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Exporter;
2
3111µsrequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
91300nsour $Debug = 0;
101100nsour $ExportLevel = 0;
111200nsour $Verbose ||= 0;
121400nsour $VERSION = '5.68';
131200nsour (%Cache);
14
15
# spent 1.96ms (1.88+84µs) within Exporter::as_heavy which was called 4 times, avg 490µs/call: # 2 times (1.86ms+81µs) by Exporter::export_to_level at line 81, avg 972µs/call # 2 times (14µs+3µs) by Exporter::export at line 25, avg 9µs/call
sub as_heavy {
164108µ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
19411µs my $c = (caller(1))[3];
20424µs411µs $c =~ s/.*:://;
# spent 11µs making 4 calls to Exporter::CORE:subst, avg 3µs/call
21418µ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
sub export {
25210µs4232µ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
sub import {
2917481µs my $pkg = shift;
30174117µs my $callpkg = caller($ExportLevel);
31
3217460µs if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
3314µs *{$callpkg."::import"} = \&import;
34111µs return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
38173287µ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.
41173206µs my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
4217388µs return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
44173110µs my $export_cache = ($Cache{$pkg} ||= {});
45173117µs my $args = @_ or @_ = @$exports;
46
4717353µs if ($args and not %$export_cache) {
48 s/^&//, $export_cache->{$_} = 1
4910970µs451129µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 129µs making 451 calls to Exporter::CORE:subst, avg 285ns/call
50 }
5117310µ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.
54173108µ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
571401.06ms203175µs foreach (@_);
# spent 175µs making 203 calls to Exporter::CORE:match, avg 860ns/call
58 } else {
59 ($heavy = /\W/) and last
6033296µs10448µs foreach (@_);
# spent 48µs making 104 calls to Exporter::CORE:match, avg 462ns/call
61 }
6217319µs return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
63 local $SIG{__WARN__} =
64173804µs sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
65 # shortcut for the common case of no type character
661732.65ms *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_;
67}
68
69# Default methods
70
71sub 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
sub export_to_level {
81215µs42.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
84sub export_tags {
85 goto &{as_heavy()};
86}
87
88sub export_ok_tags {
89 goto &{as_heavy()};
90}
91
92sub require_version {
93 goto &{as_heavy()};
94}
95
9615µs1;
97__END__
 
# spent 223µs within Exporter::CORE:match which was called 307 times, avg 725ns/call: # 203 times (175µs+0s) by Exporter::import at line 57, avg 860ns/call # 104 times (48µs+0s) by Exporter::import at line 60, avg 462ns/call
sub Exporter::CORE:match; # opcode
# spent 140µs within Exporter::CORE:subst which was called 455 times, avg 307ns/call: # 451 times (129µs+0s) by Exporter::import at line 49, avg 285ns/call # 4 times (11µs+0s) by Exporter::as_heavy at line 20, avg 3µs/call
sub Exporter::CORE:subst; # opcode