← 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 17:10:45 2013
Reported on Tue Oct 15 17:11:22 2013

Filename/usr/share/perl/5.10/Module/Load.pm
StatementsExecuted 18 statements in 480µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11120µs25µsModule::Load::::BEGIN@5Module::Load::BEGIN@5
11115µs19µsModule::Load::::importModule::Load::import
11110µs23µsModule::Load::::BEGIN@37Module::Load::BEGIN@37
1119µs30µsModule::Load::::BEGIN@11Module::Load::BEGIN@11
1114µs4µ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
5328µs230µs
# spent 25µs (20+5) within Module::Load::BEGIN@5 which was called: # once (20µs+5µs) by Module::Load::Conditional::BEGIN@5 at line 5
use strict;
# spent 25µs making 1 call to Module::Load::BEGIN@5 # spent 5µs making 1 call to strict::import
6346µs14µs
# spent 4µs within Module::Load::BEGIN@6 which was called: # once (4µs+0s) by Module::Load::Conditional::BEGIN@5 at line 6
use File::Spec ();
# spent 4µs making 1 call to Module::Load::BEGIN@6
7
8
# spent 19µ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
113151µs250µs
# spent 30µs (9+21) within Module::Load::BEGIN@11 which was called: # once (9µs+21µs) by Module::Load::Conditional::BEGIN@5 at line 11
{ no strict 'refs';
# spent 30µs making 1 call to Module::Load::BEGIN@11 # spent 21µ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.
373230µs236µs
# spent 23µs (10+13) within Module::Load::BEGIN@37 which was called: # once (10µs+13µs) by Module::Load::Conditional::BEGIN@5 at line 37
{ no strict 'refs';
# spent 23µs making 1 call to Module::Load::BEGIN@37 # spent 13µ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
69110µ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__