← Index
NYTProf Performance Profile   « line view »
For /Users/brian/bin/perls/cpan5.26.1
  Run on Sat Dec 30 01:41:10 2017
Reported on Sat Dec 30 01:44:14 2017

Filename/usr/local/perls/perl-5.26.1/lib/5.26.1/Exporter.pm
StatementsExecuted 1098 statements in 6.11ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
6969324.82ms8.02msExporter::::importExporter::import
63521340µs340µsExporter::::CORE:matchExporter::CORE:match (opcode)
2321326µs446µsExporter::::as_heavyExporter::as_heavy
11621154µs154µsExporter::::CORE:substExporter::CORE:subst (opcode)
181196µs438µsExporter::::exportExporter::export
55554µs158µsExporter::::export_ok_tagsExporter::export_ok_tags
0000s0sExporter::::__ANON__[:64]Exporter::__ANON__[:64]
0000s0sExporter::::export_failExporter::export_fail
0000s0sExporter::::export_tagsExporter::export_tags
0000s0sExporter::::export_to_levelExporter::export_to_level
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
3require 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
9our $Debug = 0;
10our $ExportLevel = 0;
11our $Verbose ||= 0;
12our $VERSION = '5.72';
13our (%Cache);
14
15
# spent 446µs (326+120) within Exporter::as_heavy which was called 23 times, avg 19µs/call: # 18 times (251µs+91µs) by Exporter::export at line 25, avg 19µs/call # 5 times (75µs+29µs) by Exporter::export_ok_tags at line 89, avg 21µs/call
sub as_heavy {
162319µ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
1923143µs my $c = (caller(1))[3];
2023189µs23120µs $c =~ s/.*:://;
# spent 120µs making 23 calls to Exporter::CORE:subst, avg 5µs/call
2123135µs \&{"Exporter::Heavy::heavy_$c"};
22}
23
24
# spent 438µs (96+342) within Exporter::export which was called 18 times, avg 24µs/call: # 18 times (96µs+342µs) by Exporter::import at line 62, avg 24µs/call
sub export {
2518152µs362.73ms goto &{as_heavy()};
# spent 2.39ms making 18 calls to Exporter::Heavy::heavy_export, avg 133µs/call # spent 342µs making 18 calls to Exporter::as_heavy, avg 19µs/call
26}
27
28
# spent 8.02ms (4.82+3.20) within Exporter::import which was called 69 times, avg 116µs/call: # once (85µs+328µs) by IO::Compress::Adapter::Deflate::BEGIN@8 at line 8 of IO/Compress/Adapter/Deflate.pm # once (302µs+25µs) by Archive::Tar::BEGIN@19 at line 19 of Archive/Tar.pm # once (81µs+232µs) by Storable::BEGIN@59 at line 60 of Storable.pm # once (272µs+16µs) by Archive::Tar::File::BEGIN@12 at line 12 of Archive/Tar/File.pm # once (65µs+212µs) by File::Glob::import at line 46 of File/Glob.pm # once (48µs+225µs) by IO::Compress::Gzip::BEGIN@15 at line 15 of IO/Compress/Gzip.pm # once (57µs+203µs) by Compress::Zlib::BEGIN@464 at line 464 of Compress/Zlib.pm # once (54µs+200µs) by IO::Compress::Zlib::Extra::BEGIN@13 at line 13 of IO/Compress/Zlib/Extra.pm # once (232µs+17µs) by IO::Compress::RawDeflate::BEGIN@11 at line 11 of IO/Compress/RawDeflate.pm # once (51µs+193µs) by IO::Uncompress::Gunzip::BEGIN@16 at line 16 of IO/Uncompress/Gunzip.pm # once (209µs+15µs) by Compress::Zlib::BEGIN@11 at line 11 of Compress/Zlib.pm # once (40µs+180µs) by IO::Uncompress::Bunzip2::BEGIN@7 at line 7 of IO/Uncompress/Bunzip2.pm # once (74µs+145µs) by IO::Compress::RawDeflate::BEGIN@10 at line 10 of IO/Compress/RawDeflate.pm # once (203µs+11µs) by IO::Uncompress::Adapter::Bunzip2::BEGIN@9 at line 9 of IO/Uncompress/Adapter/Bunzip2.pm # once (200µs+11µs) by IO::Compress::Gzip::BEGIN@12 at line 12 of IO/Compress/Gzip.pm # once (188µs+16µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 8 of IO/Uncompress/RawInflate.pm # once (175µs+7µs) by Archive::Tar::BEGIN@12 at line 12 of Archive/Tar.pm # once (29µs+129µs) by IO::Uncompress::Adapter::Inflate::BEGIN@7 at line 7 of IO/Uncompress/Adapter/Inflate.pm # once (149µs+8µs) by IO::Uncompress::Base::BEGIN@19 at line 19 of IO/Uncompress/Base.pm # once (27µs+128µs) by IO::Compress::Adapter::Bzip2::BEGIN@7 at line 7 of IO/Compress/Adapter/Bzip2.pm # once (20µs+134µs) by IO::Compress::Bzip2::BEGIN@54 at line 54 of IO/Compress/Bzip2.pm # once (144µs+9µs) by IO::Uncompress::Base::BEGIN@17 at line 17 of IO/Uncompress/Base.pm # once (142µs+8µs) by IO::Compress::Base::BEGIN@9 at line 9 of IO/Compress/Base.pm # once (130µs+9µs) by Compress::Zlib::BEGIN@10 at line 10 of Compress/Zlib.pm # once (126µs+11µs) by Archive::Tar::File::BEGIN@5 at line 5 of Archive/Tar/File.pm # once (25µs+112µs) by IO::Compress::Gzip::BEGIN@14 at line 14 of IO/Compress/Gzip.pm # once (20µs+116µs) by IO::Compress::RawDeflate::BEGIN@119 at line 119 of IO/Compress/RawDeflate.pm # once (24µs+108µs) by IO::Compress::Adapter::Deflate::BEGIN@7 at line 7 of IO/Compress/Adapter/Deflate.pm # once (26µs+105µs) by IO::Uncompress::Gunzip::BEGIN@15 at line 15 of IO/Uncompress/Gunzip.pm # once (21µs+104µs) by IO::Uncompress::Adapter::Bunzip2::BEGIN@7 at line 7 of IO/Uncompress/Adapter/Bunzip2.pm # once (18µs+107µs) by IO::Uncompress::RawInflate::BEGIN@9 at line 9 of IO/Uncompress/RawInflate.pm # once (103µs+6µs) by Archive::Tar::BEGIN@10 at line 10 of Archive/Tar.pm # once (102µs+5µs) by IO::Compress::Adapter::Bzip2::BEGIN@9 at line 9 of IO/Compress/Adapter/Bzip2.pm # once (78µs+6µs) by URI::WithBase::BEGIN@7 at line 7 of URI/WithBase.pm # once (68µs+5µs) by Compress::Zlib::BEGIN@6 at line 6 of Compress/Zlib.pm # once (62µs+3µs) by URI::file::BEGIN@9 at line 9 of URI/file.pm # once (58µs+2µs) by IO::Uncompress::Adapter::Inflate::BEGIN@8 at line 8 of IO/Uncompress/Adapter/Inflate.pm # once (55µs+5µs) by URI::URL::BEGIN@19 at line 19 of URI/URL.pm # once (55µs+3µs) by IO::Zlib::BEGIN@306 at line 306 of IO/Zlib.pm # once (56µs+2µs) by Tie::Handle::BEGIN@123 at line 123 of Tie/Handle.pm # once (51µs+2µs) by IO::Zlib::BEGIN@291 at line 291 of IO/Zlib.pm # once (47µs+4µs) by URI::file::Unix::BEGIN@8 at line 8 of URI/file/Unix.pm # once (43µs+5µs) by URI::_generic::BEGIN@8 at line 8 of URI/_generic.pm # once (45µs+3µs) by URI::_query::BEGIN@7 at line 7 of URI/_query.pm # once (47µs+1µs) by Digest::SHA::BEGIN@8 at line 8 of Digest/SHA.pm # once (45µs+2µs) by IO::Compress::Base::Common::BEGIN@523 at line 523 of IO/Compress/Base/Common.pm # once (43µs+4µs) by Compress::Raw::Zlib::BEGIN@6 at line 6 of Compress/Raw/Zlib.pm # once (43µs+2µs) by Compress::Raw::Bzip2::BEGIN@9 at line 9 of Compress/Raw/Bzip2.pm # once (43µs+0s) by IO::Compress::Bzip2::BEGIN@8 at line 8 of IO/Compress/Bzip2.pm # once (41µs+1000ns) by IO::Uncompress::Base::BEGIN@20 at line 20 of IO/Uncompress/Base.pm # once (38µs+3µs) by File::GlobMapper::BEGIN@5 at line 5 of File/GlobMapper.pm # once (34µs+3µs) by IO::Compress::Base::Common::BEGIN@7 at line 7 of IO/Compress/Base/Common.pm # once (34µs+2µs) by IO::Zlib::BEGIN@292 at line 292 of IO/Zlib.pm # once (35µs+1µs) by Archive::Tar::BEGIN@13 at line 13 of Archive/Tar.pm # once (31µs+2µs) by IO::Compress::Base::Common::BEGIN@8 at line 8 of IO/Compress/Base/Common.pm # once (29µs+3µs) by IO::Compress::RawDeflate::BEGIN@120 at line 120 of IO/Compress/RawDeflate.pm # once (29µs+2µs) by IO::Uncompress::Base::BEGIN@23 at line 23 of IO/Uncompress/Base.pm # once (29µs+0s) by IO::Compress::Base::BEGIN@914 at line 914 of IO/Compress/Base.pm # once (27µs+1µs) by Compress::Zlib::BEGIN@8 at line 8 of Compress/Zlib.pm # once (25µs+1000ns) by IO::Compress::RawDeflate::BEGIN@150 at line 150 of IO/Compress/RawDeflate.pm # once (25µs+0s) by IO::Uncompress::RawInflate::BEGIN@11 at line 11 of IO/Uncompress/RawInflate.pm # once (24µs+0s) by IO::Compress::RawDeflate::BEGIN@9 at line 9 of IO/Compress/RawDeflate.pm # once (24µs+0s) by Compress::Zlib::BEGIN@12 at line 12 of Compress/Zlib.pm # once (22µs+0s) by IO::Uncompress::Bunzip2::BEGIN@9 at line 9 of IO/Uncompress/Bunzip2.pm # once (22µs+0s) by URI::Escape::BEGIN@140 at line 140 of URI/Escape.pm # once (21µs+0s) by IO::Uncompress::Gunzip::BEGIN@12 at line 12 of IO/Uncompress/Gunzip.pm # once (19µs+0s) by Compress::Zlib::BEGIN@7 at line 7 of Compress/Zlib.pm # once (19µs+0s) by Compress::Zlib::BEGIN@13 at line 13 of Compress/Zlib.pm # once (9µs+0s) by URI::URL::BEGIN@13 at line 13 of URI/URL.pm
sub import {
296951µs my $pkg = shift;
306974µs my $callpkg = caller($ExportLevel);
31
326940µs if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
33213µs *{$callpkg."::import"} = \&import;
34213µs return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
3867233µ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.
4167165µs my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
426761µs return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
4467104µs my $export_cache = ($Cache{$pkg} ||= {});
4567178µs my $args = @_ or @_ = @$exports;
46
476720µs if ($args and not %$export_cache) {
48 s/^&//, $export_cache->{$_} = 1
494218µs9334µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 34µs making 93 calls to Exporter::CORE:subst, avg 366ns/call
50 }
516711µ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.
546744µ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
5742635µs199173µs foreach (@_);
# spent 173µs making 199 calls to Exporter::CORE:match, avg 869ns/call
58 } else {
59 ($heavy = /\W/) and last
6025801µs436167µs foreach (@_);
# spent 167µs making 436 calls to Exporter::CORE:match, avg 383ns/call
61 }
6267138µs18438µs return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
# spent 438µs making 18 calls to Exporter::export, avg 24µs/call
63 local $SIG{__WARN__} =
6449315µs sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
65 # shortcut for the common case of no type character
66492.30ms *{"$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
88
# spent 158µs (54+104) within Exporter::export_ok_tags which was called 5 times, avg 32µs/call: # once (21µs+19µs) by Archive::Tar::Constant::BEGIN@74 at line 24 of IO/Compress/Bzip2.pm # once (10µs+24µs) by IO::Uncompress::Gunzip::BEGIN@12 at line 25 of IO/Uncompress/RawInflate.pm # once (12µs+22µs) by IO::Compress::Gzip::BEGIN@11 at line 43 of IO/Compress/RawDeflate.pm # once (6µs+20µs) by Compress::Zlib::BEGIN@12 at line 36 of IO/Compress/Gzip.pm # once (5µs+19µs) by Compress::Zlib::BEGIN@13 at line 27 of IO/Uncompress/Gunzip.pm
sub export_ok_tags {
89560µs10247µs goto &{as_heavy()};
# spent 143µs making 5 calls to Exporter::Heavy::heavy_export_ok_tags, avg 29µs/call # spent 104µs making 5 calls to Exporter::as_heavy, avg 21µs/call
90}
91
92sub require_version {
93 goto &{as_heavy()};
94}
95
961;
97__END__
 
# spent 340µs within Exporter::CORE:match which was called 635 times, avg 535ns/call: # 436 times (167µs+0s) by Exporter::import at line 60, avg 383ns/call # 199 times (173µs+0s) by Exporter::import at line 57, avg 869ns/call
sub Exporter::CORE:match; # opcode
# spent 154µs within Exporter::CORE:subst which was called 116 times, avg 1µs/call: # 93 times (34µs+0s) by Exporter::import at line 49, avg 366ns/call # 23 times (120µs+0s) by Exporter::as_heavy at line 20, avg 5µs/call
sub Exporter::CORE:subst; # opcode