← Index
NYTProf Performance Profile   « line view »
For Makefile.PL
  Run on Sun Mar 1 16:04:44 2015
Reported on Sun Mar 1 16:09:02 2015

FilenameC:/tmp64ng/perl/lib/Exporter.pm
StatementsExecuted 668 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
51115.6ms15.6msExporter::::as_heavyExporter::as_heavy
81210s0sExporter::::CORE:matchExporter::CORE:match (opcode)
52210s0sExporter::::CORE:substExporter::CORE:subst (opcode)
0000s0sExporter::::__ANON__[:64]Exporter::__ANON__[:64]
5110s15.6msExporter::::exportExporter::export
0000s0sExporter::::export_failExporter::export_fail
0000s0sExporter::::export_ok_tagsExporter::export_ok_tags
0000s0sExporter::::export_tagsExporter::export_tags
0000s0sExporter::::export_to_levelExporter::export_to_level
4443220s15.6msExporter::::importExporter::import
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
310srequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
910sour $Debug = 0;
1010sour $ExportLevel = 0;
1110sour $Verbose ||= 0;
1210sour $VERSION = '5.71';
1310sour (%Cache);
14
15
# spent 15.6ms within Exporter::as_heavy which was called 5 times, avg 3.12ms/call: # 5 times (15.6ms+0s) by Exporter::export at line 25, avg 3.12ms/call
sub as_heavy {
1650s 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
1950s my $c = (caller(1))[3];
2050s50s $c =~ s/.*:://;
# spent 0s making 5 calls to Exporter::CORE:subst, avg 0s/call
2150s \&{"Exporter::Heavy::heavy_$c"};
22}
23
24
# spent 15.6ms (0s+15.6) within Exporter::export which was called 5 times, avg 3.12ms/call: # 5 times (0s+15.6ms) by Exporter::import at line 62, avg 3.12ms/call
sub export {
2550s1015.6ms goto &{as_heavy()};
# spent 15.6ms making 5 calls to Exporter::as_heavy, avg 3.12ms/call # spent 0s making 5 calls to Exporter::Heavy::heavy_export, avg 0s/call
26}
27
28
# spent 15.6ms (0s+15.6) within Exporter::import which was called 44 times, avg 355µs/call: # 2 times (0s+0s) by main::BEGIN@1.10 or main::BEGIN@1.2 at line 1 of Prec/Makefile.PL, avg 0s/call # once (0s+15.6ms) by ExtUtils::MM_Any::BEGIN@12 at line 12 of ExtUtils/MM_Any.pm # once (0s+0s) by Win32::API::Struct::BEGIN@14 at line 14 of Win32/API/Struct.pm # once (0s+0s) by Win32::API::Struct::BEGIN@15 at line 15 of Win32/API/Struct.pm # once (0s+0s) by Cwd::BEGIN@171 at line 171 of Cwd.pm # once (0s+0s) by ExtUtils::MM_Win32::BEGIN@23 at line 23 of ExtUtils/MM_Win32.pm # once (0s+0s) by ExtUtils::MM_Win32::BEGIN@25 at line 25 of ExtUtils/MM_Win32.pm # once (0s+0s) by CPAN::Meta::YAML::BEGIN@804 at line 804 of CPAN/Meta/YAML.pm # once (0s+0s) by CPAN::Meta::YAML::BEGIN@22 at line 22 of CPAN/Meta/YAML.pm # once (0s+0s) by ExtUtils::Liblist::Kid::BEGIN@18 at line 18 of ExtUtils/Liblist/Kid.pm # once (0s+0s) by ExtUtils::Liblist::Kid::BEGIN@17 at line 17 of ExtUtils/Liblist/Kid.pm # once (0s+0s) by ExtUtils::MakeMaker::BEGIN@11 at line 11 of ExtUtils/MakeMaker.pm # once (0s+0s) by ExtUtils::MakeMaker::BEGIN@220 at line 220 of ExtUtils/MakeMaker.pm # once (0s+0s) by ExtUtils::MakeMaker::BEGIN@12 at line 12 of ExtUtils/MakeMaker.pm # once (0s+0s) by Parse::CPAN::Meta::BEGIN@8 at line 8 of Parse/CPAN/Meta.pm # once (0s+0s) by Parse::CPAN::Meta::BEGIN@7 at line 7 of Parse/CPAN/Meta.pm # once (0s+0s) by Encode::BEGIN@12 at line 12 of Encode.pm # once (0s+0s) by Encode::BEGIN@47 at line 47 of Encode.pm # once (0s+0s) by Win32::API::Type::BEGIN@21 at line 21 of Win32/API/Type.pm # once (0s+0s) by File::Path::BEGIN@6 at line 6 of File/Path.pm # once (0s+0s) by Text::ParseWords::BEGIN@8 at line 8 of Text/ParseWords.pm # once (0s+0s) by ExtUtils::Manifest::BEGIN@6 at line 6 of ExtUtils/Manifest.pm # once (0s+0s) by ExtUtils::Manifest::BEGIN@7 at line 7 of ExtUtils/Manifest.pm # once (0s+0s) by ExtUtils::Manifest::BEGIN@9 at line 9 of ExtUtils/Manifest.pm # once (0s+0s) by ExtUtils::Manifest::BEGIN@5 at line 5 of ExtUtils/Manifest.pm # once (0s+0s) by Encode::Byte::BEGIN@4 at line 4 of Encode/Byte.pm # once (0s+0s) by ExtUtils::MM_Unix::BEGIN@1250 at line 1250 of ExtUtils/MM_Unix.pm # once (0s+0s) by ExtUtils::MM_Unix::BEGIN@7 at line 7 of ExtUtils/MM_Unix.pm # once (0s+0s) by ExtUtils::MM_Unix::BEGIN@14 at line 14 of ExtUtils/MM_Unix.pm # once (0s+0s) by ExtUtils::MM_Unix::BEGIN@9 at line 9 of ExtUtils/MM_Unix.pm # once (0s+0s) by ExtUtils::MM_Unix::BEGIN@2472 at line 2472 of ExtUtils/MM_Unix.pm # once (0s+0s) by ExtUtils::MM_Any::BEGIN@8 at line 8 of ExtUtils/MM_Any.pm # once (0s+0s) by ExtUtils::MM_Any::BEGIN@6 at line 6 of ExtUtils/MM_Any.pm # once (0s+0s) by main::BEGIN@1 at line 1 of Makefile.PL # once (0s+0s) by Win32::API::BEGIN@63 at line 63 of Win32/API.pm # once (0s+0s) by Win32::API::BEGIN@36 at line 36 of Win32/API.pm # once (0s+0s) by Win32::API::BEGIN@62 at line 62 of Win32/API.pm # once (0s+0s) by DirHandle::BEGIN@32 at line 32 of DirHandle.pm # once (0s+0s) by DirHandle::BEGIN@31 at line 31 of DirHandle.pm # once (0s+0s) by CPAN::Meta::BEGIN@55 at line 55 of CPAN/Meta.pm # once (0s+0s) by CPAN::Meta::Prereqs::BEGIN@16 at line 16 of CPAN/Meta/Prereqs.pm # once (0s+0s) by CPAN::Meta::Prereqs::BEGIN@15 at line 15 of CPAN/Meta/Prereqs.pm # once (0s+0s) by Encode::Alias::BEGIN@8 at line 8 of Encode/Alias.pm
sub import {
29440s my $pkg = shift;
30440s my $callpkg = caller($ExportLevel);
31
32440s if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
3320s *{$callpkg."::import"} = \&import;
3420s return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
38420s 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.
41420s my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
42420s return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
44420s my $export_cache = ($Cache{$pkg} ||= {});
45420s my $args = @_ or @_ = @$exports;
46
47420s if ($args and not %$export_cache) {
48 s/^&//, $export_cache->{$_} = 1
4960s470s foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 0s making 47 calls to Exporter::CORE:subst, avg 0s/call
50 }
51420s 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.
54420s 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
57250s460s foreach (@_);
# spent 0s making 46 calls to Exporter::CORE:match, avg 0s/call
58 } else {
59 ($heavy = /\W/) and last
60170s350s foreach (@_);
# spent 0s making 35 calls to Exporter::CORE:match, avg 0s/call
61 }
62420s515.6ms return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
# spent 15.6ms making 5 calls to Exporter::export, avg 3.12ms/call
63 local $SIG{__WARN__} =
64370s sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
65 # shortcut for the common case of no type character
66370s *{"$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
80sub export_to_level {
81 goto &{as_heavy()};
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
9610s1;
97__END__
 
# spent 0s within Exporter::CORE:match which was called 81 times, avg 0s/call: # 46 times (0s+0s) by Exporter::import at line 57, avg 0s/call # 35 times (0s+0s) by Exporter::import at line 60, avg 0s/call
sub Exporter::CORE:match; # opcode
# spent 0s within Exporter::CORE:subst which was called 52 times, avg 0s/call: # 47 times (0s+0s) by Exporter::import at line 49, avg 0s/call # 5 times (0s+0s) by Exporter::as_heavy at line 20, avg 0s/call
sub Exporter::CORE:subst; # opcode