← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:07 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Exporter/Lite.pm
StatementsExecuted 26 statements in 340µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
21116µs18µsExporter::Lite::::_exportExporter::Lite::_export
22211µs29µsExporter::Lite::::importExporter::Lite::import
1118µs10µsExporter::Lite::::BEGIN@4Exporter::Lite::BEGIN@4
1115µs12µsExporter::Lite::::BEGIN@50Exporter::Lite::BEGIN@50
1114µs5µsExporter::Lite::::BEGIN@5Exporter::Lite::BEGIN@5
1114µs10µsExporter::Lite::::BEGIN@15Exporter::Lite::BEGIN@15
2112µs2µsExporter::Lite::::CORE:substExporter::Lite::CORE:subst (opcode)
0000s0sExporter::Lite::::_not_exportedExporter::Lite::_not_exported
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Exporter::Lite;
2
315µsrequire 5.006;
4213µs213µs
# spent 10µs (8+3) within Exporter::Lite::BEGIN@4 which was called: # once (8µs+3µs) by Time::Duration::Parse::BEGIN@8 at line 4
use warnings;
# spent 10µs making 1 call to Exporter::Lite::BEGIN@4 # spent 3µs making 1 call to warnings::import
5240µs26µs
# spent 5µs (4+900ns) within Exporter::Lite::BEGIN@5 which was called: # once (4µs+900ns) by Time::Duration::Parse::BEGIN@8 at line 5
use strict;
# spent 5µs making 1 call to Exporter::Lite::BEGIN@5 # spent 900ns making 1 call to strict::import
6
71300nsour $VERSION = '0.07';
81500nsour @EXPORT = qw(import);
9
10
11
# spent 29µs (11+18) within Exporter::Lite::import which was called 2 times, avg 14µs/call: # once (6µs+10µs) by Time::Duration::Parse::BEGIN@8 at line 8 of Time/Duration/Parse.pm # once (5µs+7µs) by CHI::Util::BEGIN@10 at line 10 of CHI/Util.pm
sub import {
122800ns my($exporter, @imports) = @_;
1322µs my($caller, $file, $line) = caller;
14
152130µs216µs
# spent 10µs (4+6) within Exporter::Lite::BEGIN@15 which was called: # once (4µs+6µs) by Time::Duration::Parse::BEGIN@8 at line 15
no strict 'refs';
# spent 10µs making 1 call to Exporter::Lite::BEGIN@15 # spent 6µs making 1 call to strict::unimport
16
1723µs unless( @imports ) { # Default import.
18 @imports = @{$exporter.'::EXPORT'};
19 }
20 else {
21 # Because @EXPORT_OK = () would indicate that nothing is
22 # to be exported, we cannot simply check the length of @EXPORT_OK.
23 # We must to oddness to see if the variable exists at all as
24 # well as avoid autovivification.
25 # XXX idea stolen from base.pm, this might be all unnecessary
26 my $eokglob;
27 if( $eokglob = ${$exporter.'::'}{EXPORT_OK} and *$eokglob{ARRAY} ) {
28 if( @{$exporter.'::EXPORT_OK'} ) {
29 # This can also be cached.
30 my %ok = map { s/^&//; $_ => 1 } @{$exporter.'::EXPORT_OK'},
31 @{$exporter.'::EXPORT'};
32
33 my($denied) = grep {s/^&//; !$ok{$_}} @imports;
34 _not_exported($denied, $exporter, $file, $line) if $denied;
35 }
36 else { # We don't export anything.
37 _not_exported($imports[0], $exporter, $file, $line);
38 }
39 }
40 }
41
4225µs218µs _export($caller, $exporter, @imports);
# spent 18µs making 2 calls to Exporter::Lite::_export, avg 9µs/call
43}
44
- -
47
# spent 18µs (16+2) within Exporter::Lite::_export which was called 2 times, avg 9µs/call: # 2 times (16µs+2µs) by Exporter::Lite::import at line 42, avg 9µs/call
sub _export {
482700ns my($caller, $exporter, @imports) = @_;
49
502119µs219µs
# spent 12µs (5+7) within Exporter::Lite::BEGIN@50 which was called: # once (5µs+7µs) by Time::Duration::Parse::BEGIN@8 at line 50
no strict 'refs';
# spent 12µs making 1 call to Exporter::Lite::BEGIN@50 # spent 7µs making 1 call to strict::unimport
51
52 # Stole this from Exporter::Heavy. I'm sure it can be written better
53 # but I'm lazy at the moment.
5425µs foreach my $sym (@imports) {
55 # shortcut for the common case of no type character
56214µs22µs (*{$caller.'::'.$sym} = \&{$exporter.'::'.$sym}, next)
# spent 2µs making 2 calls to Exporter::Lite::CORE:subst, avg 850ns/call
57 unless $sym =~ s/^(\W)//;
58
59 my $type = $1;
60 my $caller_sym = $caller.'::'.$sym;
61 my $export_sym = $exporter.'::'.$sym;
62 *{$caller_sym} =
63 $type eq '&' ? \&{$export_sym} :
64 $type eq '$' ? \${$export_sym} :
65 $type eq '@' ? \@{$export_sym} :
66 $type eq '%' ? \%{$export_sym} :
67 $type eq '*' ? *{$export_sym} :
68 do { require Carp; Carp::croak("Can't export symbol: $type$sym") };
69 }
70}
71
72
73#"#
74sub _not_exported {
75 my($thing, $exporter, $file, $line) = @_;
76 die sprintf qq|"%s" is not exported by the %s module at %s line %d\n|,
77 $thing, $exporter, $file, $line;
78}
79
8013µs1;
81
82__END__
 
# spent 2µs within Exporter::Lite::CORE:subst which was called 2 times, avg 850ns/call: # 2 times (2µs+0s) by Exporter::Lite::_export at line 56, avg 850ns/call
sub Exporter::Lite::CORE:subst; # opcode