← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:14 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/5.18.0/Exporter.pm
StatementsExecuted 2723 statements in 4.78ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
178175814.13ms4.57msExporter::::importExporter::import
11211.32ms1.39msExporter::::as_heavyExporter::as_heavy
31221136µs136µsExporter::::CORE:matchExporter::CORE:match (opcode)
2642147µs47µsExporter::::CORE:substExporter::CORE:subst (opcode)
82225µs84µsExporter::::exportExporter::export
32210µs1.34msExporter::::export_to_levelExporter::export_to_level
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
317µsrequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
91200nsour $Debug = 0;
1010sour $ExportLevel = 0;
111100nsour $Verbose ||= 0;
121200nsour $VERSION = '5.68';
131100nsour (%Cache);
14
15
# spent 1.39ms (1.32+68µs) within Exporter::as_heavy which was called 11 times, avg 126µs/call: # 8 times (47µs+12µs) by Exporter::export at line 25, avg 7µs/call # 3 times (1.27ms+56µs) by Exporter::export_to_level at line 81, avg 443µs/call
sub as_heavy {
161168µ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
191122µs my $c = (caller(1))[3];
201138µs1119µs $c =~ s/.*:://;
# spent 19µs making 11 calls to Exporter::CORE:subst, avg 2µs/call
211130µ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
sub export {
25827µs16453µ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
sub import {
2917848µs my $pkg = shift;
3017870µs my $callpkg = caller($ExportLevel);
31
3217834µs if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
3313µs *{$callpkg."::import"} = \&import;
3413µs return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
38177184µ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.
41177132µs my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
4217751µs return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
4417765µs my $export_cache = ($Cache{$pkg} ||= {});
4517768µs my $args = @_ or @_ = @$exports;
46
4717731µs if ($args and not %$export_cache) {
48 s/^&//, $export_cache->{$_} = 1
4911317µs25328µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 28µs making 253 calls to Exporter::CORE:subst, avg 112ns/call
50 }
511771µ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.
5417759µ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
57148759µs248116µs foreach (@_);
# spent 116µs making 248 calls to Exporter::CORE:match, avg 469ns/call
58 } else {
59 ($heavy = /\W/) and last
6029137µs6420µs foreach (@_);
# spent 20µs making 64 calls to Exporter::CORE:match, avg 312ns/call
61 }
6217730µs558µ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__} =
64172545µs sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
65 # shortcut for the common case of no type character
661722.03ms *{"$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.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
sub export_to_level {
81314µs61.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
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
9614µs1;
97__END__
 
# spent 136µs within Exporter::CORE:match which was called 312 times, avg 437ns/call: # 248 times (116µs+0s) by Exporter::import at line 57, avg 469ns/call # 64 times (20µs+0s) by Exporter::import at line 60, avg 312ns/call
sub Exporter::CORE:match; # opcode
# spent 47µs within Exporter::CORE:subst which was called 264 times, avg 178ns/call: # 253 times (28µs+0s) by Exporter::import at line 49, avg 112ns/call # 11 times (19µs+0s) by Exporter::as_heavy at line 20, avg 2µs/call
sub Exporter::CORE:subst; # opcode