← 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/5.22.0/Module/Load.pm
StatementsExecuted 38 statements in 614µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.23ms3.43msModule::Load::::_loadModule::Load::_load
11117µs32µsModule::Load::::_to_fileModule::Load::_to_file
11110µs11µsModule::Load::::BEGIN@5Module::Load::BEGIN@5
1115µs12µsModule::Load::::BEGIN@88Module::Load::BEGIN@88
1114µs7µsModule::Load::::_is_fileModule::Load::_is_file
1114µs11µsModule::Load::::BEGIN@13Module::Load::BEGIN@13
1114µs7µsModule::Load::::BEGIN@6Module::Load::BEGIN@6
1113µs3µsModule::Load::::_whoModule::Load::_who
2112µs2µsModule::Load::::CORE:matchModule::Load::CORE:match (opcode)
1112µs2µsModule::Load::::BEGIN@7Module::Load::BEGIN@7
1112µs2µsModule::Load::::loadModule::Load::load
0000s0sModule::Load::::autoloadModule::Load::autoload
0000s0sModule::Load::::autoload_remoteModule::Load::autoload_remote
0000s0sModule::Load::::importModule::Load::import
0000s0sModule::Load::::load_remoteModule::Load::load_remote
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Module::Load;
2
31300ns$VERSION = '0.32';
4
5217µs213µs
# spent 11µs (10+1) within Module::Load::BEGIN@5 which was called: # once (10µs+1µs) by BenchmarkAnything::Storage::Backend::SQL::new at line 5
use strict;
# spent 11µs making 1 call to Module::Load::BEGIN@5 # spent 2µs making 1 call to strict::import
6213µs211µs
# spent 7µs (4+3) within Module::Load::BEGIN@6 which was called: # once (4µs+3µs) by BenchmarkAnything::Storage::Backend::SQL::new at line 6
use warnings;
# spent 7µs making 1 call to Module::Load::BEGIN@6 # spent 3µs making 1 call to warnings::import
7226µs12µs
# spent 2µs within Module::Load::BEGIN@7 which was called: # once (2µs+0s) by BenchmarkAnything::Storage::Backend::SQL::new at line 7
use File::Spec ();
# spent 2µs making 1 call to Module::Load::BEGIN@7
8
9sub import {
10 my $who = _who();
11 my $h; shift;
12
132255µs217µs
# spent 11µs (4+6) within Module::Load::BEGIN@13 which was called: # once (4µs+6µs) by BenchmarkAnything::Storage::Backend::SQL::new at line 13
{ no strict 'refs';
# spent 11µs making 1 call to Module::Load::BEGIN@13 # spent 6µs making 1 call to strict::unimport
14
15 @_ or (
16 *{"${who}::load"} = \&load, # compat to prev version
17 *{"${who}::autoload"} = \&autoload,
18 return
19 );
20
21 map { $h->{$_} = () if defined $_ } @_;
22
23 (exists $h->{none} or exists $h->{''})
24 and shift, last;
25
26 ((exists $h->{autoload} and shift,1) or (exists $h->{all} and shift))
27 and *{"${who}::autoload"} = \&autoload;
28
29 ((exists $h->{load} and shift,1) or exists $h->{all})
30 and *{"${who}::load"} = \&load;
31
32 ((exists $h->{load_remote} and shift,1) or exists $h->{all})
33 and *{"${who}::load_remote"} = \&load_remote;
34
35 ((exists $h->{autoload_remote} and shift,1) or exists $h->{all})
36 and *{"${who}::autoload_remote"} = \&autoload_remote;
37
38 }
39
40}
41
42
# spent 2µs within Module::Load::load which was called: # once (2µs+0s) by BenchmarkAnything::Storage::Backend::SQL::new at line 146 of BenchmarkAnything/Storage/Backend/SQL.pm
sub load(*;@){
4315µs13.43ms goto &_load;
# spent 3.43ms making 1 call to Module::Load::_load
44}
45
46sub autoload(*;@){
47 unshift @_, 'autoimport';
48 goto &_load;
49}
50
51sub load_remote($$;@){
52 my ($dst, $src, @exp) = @_;
53
54 eval "package $dst;Module::Load::load('$src', qw/@exp/);";
55 $@ && die "$@";
56}
57
58sub autoload_remote($$;@){
59 my ($dst, $src, @exp) = @_;
60
61 eval "package $dst;Module::Load::autoload('$src', qw/@exp/);";
62 $@ && die "$@";
63}
64
65
# spent 3.43ms (1.23+2.20) within Module::Load::_load which was called: # once (1.23ms+2.20ms) by BenchmarkAnything::Storage::Backend::SQL::new at line 43
sub _load{
661600ns my $autoimport = $_[0] eq 'autoimport' and shift;
671300ns my $mod = shift or return;
6811µs13µs my $who = _who();
# spent 3µs making 1 call to Module::Load::_who
69
701600ns17µs if( _is_file( $mod ) ) {
# spent 7µs making 1 call to Module::Load::_is_file
71 require $mod;
72 } else {
73 LOAD: {
742200ns my $err;
751400ns for my $flag ( qw[1 0] ) {
761600ns132µs my $file = _to_file( $mod, $flag);
# spent 32µs making 1 call to Module::Load::_to_file
77261µs eval { require $file };
7811µs $@ ? $err .= $@ : last LOAD;
79 }
80 die $err if $err;
81 }
82 }
83
84 ### This addresses #41883: Module::Load cannot import
85 ### non-Exporter module. ->import() routines weren't
86 ### properly called when load() was used.
87
883183µs220µs
# spent 12µs (5+7) within Module::Load::BEGIN@88 which was called: # once (5µs+7µs) by BenchmarkAnything::Storage::Backend::SQL::new at line 88
{ no strict 'refs';
# spent 12µs making 1 call to Module::Load::BEGIN@88 # spent 7µs making 1 call to strict::unimport
891100ns my $import;
90
911500ns ((@_ or $autoimport) and (
92 $import = $mod->can('import')
93 ) and (
94 unshift(@_, $mod),
95 goto &$import,
96 return
97 )
98 );
99 }
100
101}
102
103
# spent 32µs (17+14) within Module::Load::_to_file which was called: # once (17µs+14µs) by Module::Load::_load at line 76
sub _to_file{
1041200ns local $_ = shift;
1051300ns my $pm = shift || '';
106
107 ## trailing blanks ignored by default. [rt #69886]
10816µs my @parts = split /::|'/, $_, -1;
109 ## make sure that we can't hop out of @INC
1101300ns shift @parts if @parts && !$parts[0];
111
112 ### because of [perl #19213], see caveats ###
113123µs421µs my $file = $^O eq 'MSWin32'
# spent 14µs making 1 call to File::Spec::Unix::catfile # spent 5µs making 1 call to File::Spec::Unix::catdir # spent 2µs making 2 calls to File::Spec::Unix::canonpath, avg 800ns/call
114 ? join "/", @parts
115 : File::Spec->catfile( @parts );
116
1171400ns $file .= '.pm' if $pm;
118
119 ### on perl's before 5.10 (5.9.5@31746) if you require
120 ### a file in VMS format, it's stored in %INC in VMS
121 ### format. Therefor, better unixify it first
122 ### Patch in reply to John Malmbergs patch (as mentioned
123 ### above) on p5p Tue 21 Aug 2007 04:55:07
1241300ns $file = VMS::Filespec::unixify($file) if $^O eq 'VMS';
125
12613µs return $file;
127}
128
12914µs
# spent 3µs within Module::Load::_who which was called: # once (3µs+0s) by Module::Load::_load at line 68
sub _who { (caller(1))[0] }
130
131
# spent 7µs (4+2) within Module::Load::_is_file which was called: # once (4µs+2µs) by Module::Load::_load at line 70
sub _is_file {
1321200ns local $_ = shift;
13318µs22µs return /^\./ ? 1 :
# spent 2µs making 2 calls to Module::Load::CORE:match, avg 1µs/call
134 /[^\w:']/ ? 1 :
135 undef
136}
137
- -
14012µs1;
141
142__END__
 
# spent 2µs within Module::Load::CORE:match which was called 2 times, avg 1µs/call: # 2 times (2µs+0s) by Module::Load::_is_file at line 133, avg 1µs/call
sub Module::Load::CORE:match; # opcode