← Index
NYTProf Performance Profile   « line view »
For index.cgi
  Run on Sat May 9 17:18:47 2020
Reported on Sat May 9 17:19:07 2020

Filename/usr/share/perl/5.18/Exporter.pm
StatementsExecuted 492 statements in 1.80ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3532221.57ms1.66msExporter::::importExporter::import
712160µs60µsExporter::::CORE:matchExporter::CORE:match (opcode)
1131139µs39µsExporter::::CORE:substExporter::CORE:subst (opcode)
0000s0sExporter::::__ANON__[:64]Exporter::__ANON__[:64]
0000s0sExporter::::as_heavyExporter::as_heavy
0000s0sExporter::::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
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
3113µsrequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
91500nsour $Debug = 0;
101200nsour $ExportLevel = 0;
111500nsour $Verbose ||= 0;
121700nsour $VERSION = '5.68';
131500nsour (%Cache);
14
15sub as_heavy {
16 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 my $c = (caller(1))[3];
20 $c =~ s/.*:://;
21 \&{"Exporter::Heavy::heavy_$c"};
22}
23
24sub export {
25 goto &{as_heavy()};
26}
27
28
# spent 1.66ms (1.57+99µs) within Exporter::import which was called 35 times, avg 48µs/call: # 3 times (119µs+6µs) by Moo::sification::BEGIN@5 or namespace::autoclean::BEGIN@10 or namespace::clean::BEGIN@11 at line 38 of Sub/Exporter/Progressive.pm, avg 42µs/call # 2 times (112µs+14µs) by String::Markov::BEGIN@12 or namespace::autoclean::BEGIN@11 at line 35 of List/Util.pm, avg 63µs/call # once (174µs+11µs) by String::Markov::BEGIN@11 at line 11 of String/Markov.pm # once (90µs+5µs) by Method::Generate::Accessor::BEGIN@4 at line 4 of Method/Generate/Accessor.pm # once (75µs+5µs) by Moo::BEGIN@4 at line 4 of Moo.pm # once (69µs+5µs) by Sub::Defer::BEGIN@5 at line 5 of Sub/Defer.pm # once (63µs+6µs) by Method::Generate::Constructor::BEGIN@4 at line 4 of Method/Generate/Constructor.pm # once (62µs+5µs) by Sub::Defer::BEGIN@6 at line 6 of Sub/Defer.pm # once (55µs+4µs) by Class::XSAccessor::BEGIN@5 at line 5 of Class/XSAccessor.pm # once (48µs+3µs) by Data::GUID::BEGIN@7 at line 7 of Data/GUID.pm # once (48µs+3µs) by Data::UUID::BEGIN@5 at line 5 of Data/UUID.pm # once (47µs+3µs) by namespace::clean::BEGIN@38 at line 38 of namespace/clean.pm # once (47µs+2µs) by Class::XSAccessor::Heavy::BEGIN@7 at line 7 of Class/XSAccessor/Heavy.pm # once (45µs+4µs) by Sub::Quote::BEGIN@7 at line 7 of Sub/Quote.pm # once (44µs+3µs) by Try::Tiny::BEGIN@15 at line 15 of Try/Tiny.pm # once (43µs+2µs) by Unicode::Normalize::BEGIN@12 at line 12 of Unicode/Normalize.pm # once (43µs+3µs) by Module::Implementation::BEGIN@9 at line 9 of Module/Implementation.pm # once (41µs+2µs) by Sub::Install::BEGIN@6 at line 6 of Sub/Install.pm # once (41µs+2µs) by Method::Generate::Accessor::BEGIN@7 at line 7 of Method/Generate/Accessor.pm # once (39µs+2µs) by Method::Generate::Constructor::BEGIN@5 at line 5 of Method/Generate/Constructor.pm # once (37µs+2µs) by Data::OptList::BEGIN@10 at line 95 of Params/Util.pm # once (32µs+2µs) by Method::Generate::Constructor::BEGIN@6 at line 6 of Method/Generate/Constructor.pm # once (30µs+2µs) by Try::Tiny::BEGIN@1 at line 1 of (eval 6)[Try/Tiny.pm:18] # once (30µs+1µs) by Method::Generate::Accessor::BEGIN@8 at line 8 of Method/Generate/Accessor.pm # once (29µs+1µs) by Sub::Quote::BEGIN@8 at line 8 of Sub/Quote.pm # once (27µs+1µs) by Method::Generate::Constructor::BEGIN@7 at line 7 of Method/Generate/Constructor.pm # once (24µs+0s) by Sub::Identify::BEGIN@4 at line 4 of Sub/Identify.pm # once (18µs+0s) by Moo::_Utils::BEGIN@27 at line 27 of Moo/_Utils.pm # once (9µs+0s) by Try::Tiny::BEGIN@12 at line 12 of Try/Tiny.pm # once (8µs+0s) by Sub::Defer::BEGIN@4 at line 4 of Sub/Defer.pm # once (8µs+0s) by Sub::Name::BEGIN@58 at line 58 of Sub/Name.pm # once (7µs+0s) by Sub::Quote::BEGIN@9 at line 9 of Sub/Quote.pm
sub import {
293531µs my $pkg = shift;
303532µs my $callpkg = caller($ExportLevel);
31
323522µs if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
33519µs *{$callpkg."::import"} = \&import;
34538µs return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
383069µ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.
413044µs my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
423019µs return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
443035µs my $export_cache = ($Cache{$pkg} ||= {});
453042µs my $args = @_ or @_ = @$exports;
46
473018µs if ($args and not %$export_cache) {
48 s/^&//, $export_cache->{$_} = 1
4910318µs11339µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 39µs making 113 calls to Exporter::CORE:subst, avg 342ns/call
50 }
51307µ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.
543021µ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
5722255µs3940µs foreach (@_);
# spent 40µs making 39 calls to Exporter::CORE:match, avg 1µs/call
58 } else {
59 ($heavy = /\W/) and last
608111µs3220µs foreach (@_);
# spent 20µs making 32 calls to Exporter::CORE:match, avg 641ns/call
61 }
62307µs return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
63 local $SIG{__WARN__} =
6430178µs sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
65 # shortcut for the common case of no type character
6630515µs *{"$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
9617µs1;
97__END__
 
# spent 60µs within Exporter::CORE:match which was called 71 times, avg 846ns/call: # 39 times (40µs+0s) by Exporter::import at line 57, avg 1µs/call # 32 times (20µs+0s) by Exporter::import at line 60, avg 641ns/call
sub Exporter::CORE:match; # opcode
# spent 39µs within Exporter::CORE:subst which was called 113 times, avg 342ns/call: # 113 times (39µs+0s) by Exporter::import at line 49, avg 342ns/call
sub Exporter::CORE:subst; # opcode