← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 11:58:52 2013
Reported on Tue Oct 15 12:01:02 2013

Filename/usr/share/perl/5.10/Module/Load.pm
StatementsExecuted 18 statements in 486µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11117µs21µsModule::Load::::BEGIN@5Module::Load::BEGIN@5
11115µs20µsModule::Load::::importModule::Load::import
11110µs34µsModule::Load::::BEGIN@11Module::Load::BEGIN@11
11110µs27µsModule::Load::::BEGIN@37Module::Load::BEGIN@37
1116µs6µsModule::Load::::BEGIN@6Module::Load::BEGIN@6
1114µs4µsModule::Load::::_whoModule::Load::_who
0000s0sModule::Load::::_is_fileModule::Load::_is_file
0000s0sModule::Load::::_to_fileModule::Load::_to_file
0000s0sModule::Load::::loadModule::Load::load
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
31700ns$VERSION = '0.16';
4
5329µs225µs
# spent 21µs (17+4) within Module::Load::BEGIN@5 which was called: # once (17µs+4µs) by Module::Load::Conditional::BEGIN@5 at line 5
use strict;
# spent 21µs making 1 call to Module::Load::BEGIN@5 # spent 4µs making 1 call to strict::import
6352µs16µs
# spent 6µs within Module::Load::BEGIN@6 which was called: # once (6µs+0s) by Module::Load::Conditional::BEGIN@5 at line 6
use File::Spec ();
# spent 6µs making 1 call to Module::Load::BEGIN@6
7
8
# spent 20µs (15+4) within Module::Load::import which was called: # once (15µs+4µs) by Module::Load::Conditional::BEGIN@5 at line 5 of Module/Load/Conditional.pm
sub import {
9311µs14µs my $who = _who();
# spent 4µs making 1 call to Module::Load::_who
10
113147µs258µs
# spent 34µs (10+24) within Module::Load::BEGIN@11 which was called: # once (10µs+24µs) by Module::Load::Conditional::BEGIN@5 at line 11
{ no strict 'refs';
# spent 34µs making 1 call to Module::Load::BEGIN@11 # spent 24µs making 1 call to strict::unimport
12 *{"${who}::load"} = *load;
13 }
14}
15
16sub load (*;@) {
17 my $mod = shift or return;
18 my $who = _who();
19
20 if( _is_file( $mod ) ) {
21 require $mod;
22 } else {
23 LOAD: {
24 my $err;
25 for my $flag ( qw[1 0] ) {
26 my $file = _to_file( $mod, $flag);
27 eval { require $file };
28 $@ ? $err .= $@ : last LOAD;
29 }
30 die $err if $err;
31 }
32 }
33
34 ### This addresses #41883: Module::Load cannot import
35 ### non-Exporter module. ->import() routines weren't
36 ### properly called when load() was used.
373233µs243µs
# spent 27µs (10+17) within Module::Load::BEGIN@37 which was called: # once (10µs+17µs) by Module::Load::Conditional::BEGIN@5 at line 37
{ no strict 'refs';
# spent 27µs making 1 call to Module::Load::BEGIN@37 # spent 17µs making 1 call to strict::unimport
38 my $import;
39 if (@_ and $import = $mod->can('import')) {
40 unshift @_, $mod;
41 goto &$import;
42 }
43 }
44}
45
46sub _to_file{
47 local $_ = shift;
48 my $pm = shift || '';
49
50 my @parts = split /::/;
51
52 ### because of [perl #19213], see caveats ###
53 my $file = $^O eq 'MSWin32'
54 ? join "/", @parts
55 : File::Spec->catfile( @parts );
56
57 $file .= '.pm' if $pm;
58
59 ### on perl's before 5.10 (5.9.5@31746) if you require
60 ### a file in VMS format, it's stored in %INC in VMS
61 ### format. Therefor, better unixify it first
62 ### Patch in reply to John Malmbergs patch (as mentioned
63 ### above) on p5p Tue 21 Aug 2007 04:55:07
64 $file = VMS::Filespec::unixify($file) if $^O eq 'VMS';
65
66 return $file;
67}
68
6919µs
# spent 4µs within Module::Load::_who which was called: # once (4µs+0s) by Module::Load::import at line 9
sub _who { (caller(1))[0] }
70
71sub _is_file {
72 local $_ = shift;
73 return /^\./ ? 1 :
74 /[^\w:']/ ? 1 :
75 undef
76 #' silly bbedit..
77}
78
79
8013µs1;
81
82__END__