← 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:47 2013

Filename/usr/lib/perl/5.10/DynaLoader.pm
StatementsExecuted 622 statements in 10.8ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
14113.74ms3.74msDynaLoader::::dl_load_fileDynaLoader::dl_load_file (xsub)
1111.89ms2.07msDynaLoader::::BEGIN@24DynaLoader::BEGIN@24
1414141.79ms8.85msDynaLoader::::bootstrapDynaLoader::bootstrap
2821368µs368µsDynaLoader::::CORE:substDynaLoader::CORE:subst (opcode)
7611340µs340µsDynaLoader::::CORE:ftdirDynaLoader::CORE:ftdir (opcode)
1411163µs163µsDynaLoader::::dl_install_xsubDynaLoader::dl_install_xsub (xsub)
141172µs72µsDynaLoader::::CORE:ftfileDynaLoader::CORE:ftfile (opcode)
141169µs69µsDynaLoader::::dl_find_symbolDynaLoader::dl_find_symbol (xsub)
141168µs68µsDynaLoader::::CORE:ftsizeDynaLoader::CORE:ftsize (opcode)
141146µs46µsDynaLoader::::dl_load_flagsDynaLoader::dl_load_flags
141144µs44µsDynaLoader::::dl_undef_symbolsDynaLoader::dl_undef_symbols (xsub)
11123µs23µsDynaLoader::::BEGIN@17DynaLoader::BEGIN@17
0000s0sDynaLoader::::bootstrap_inheritDynaLoader::bootstrap_inherit
0000s0sDynaLoader::::croakDynaLoader::croak
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# Generated from DynaLoader_pm.PL
2
3package DynaLoader;
4
5# And Gandalf said: 'Many folk like to know beforehand what is to
6# be set on the table; but those who have laboured to prepare the
7# feast like to keep their secret; for wonder makes the words of
8# praise louder.'
9
10# (Quote from Tolkien suggested by Anno Siegel.)
11#
12# See pod text at end of file for documentation.
13# See also ext/DynaLoader/README in source tree for other information.
14#
15# Tim.Bunce@ig.co.uk, August 1994
16
17
# spent 23µs within DynaLoader::BEGIN@17 which was called: # once (23µs+0s) by DBI::BEGIN@157 at line 19
BEGIN {
18119µs $VERSION = '1.10';
19164µs123µs}
# spent 23µs making 1 call to DynaLoader::BEGIN@17
20
211124µsrequire AutoLoader;
2213µs*AUTOLOAD = \&AutoLoader::AUTOLOAD;
23
2431.61ms22.11ms
# spent 2.07ms (1.89+178µs) within DynaLoader::BEGIN@24 which was called: # once (1.89ms+178µs) by DBI::BEGIN@157 at line 24
use Config;
# spent 2.07ms making 1 call to DynaLoader::BEGIN@24 # spent 41µs making 1 call to Config::import
25
26# enable debug/trace messages from DynaLoader perl code
2713µs$dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
28
29#
30# Flags to alter dl_load_file behaviour. Assigned bits:
31# 0x01 make symbols available for linking later dl_load_file's.
32# (only known to work on Solaris 2 using dlopen(RTLD_GLOBAL))
33# (ignored under VMS; effect is built-in to image linking)
34#
35# This is called as a class method $module->dl_load_flags. The
36# definition here will be inherited and result on "default" loading
37# behaviour unless a sub-class of DynaLoader defines its own version.
38#
39
401455µs
# spent 46µs within DynaLoader::dl_load_flags which was called 14 times, avg 3µs/call: # 14 times (46µs+0s) by DynaLoader::bootstrap at line 192, avg 3µs/call
sub dl_load_flags { 0x00 }
41
42128µs32.50ms($dl_dlext, $dl_so, $dlsrc) = @Config::Config{qw(dlext so dlsrc)};
# spent 2.50ms making 3 calls to Config::FETCH, avg 835µs/call
43
4411µs$do_expand = 0;
45
4612µs@dl_require_symbols = (); # names of symbols we need
471900ns@dl_resolve_using = (); # names of files to link with
481900ns@dl_library_path = (); # path to look for files
49
50#XSLoader.pm may have added elements before we were required
51#@dl_shared_objects = (); # shared objects for symbols we have
52#@dl_librefs = (); # things we have loaded
53#@dl_modules = (); # Modules we have loaded
54
55# This is a fix to support DLD's unfortunate desire to relink -lc
5611µs@dl_resolve_using = dl_findfile('-lc') if $dlsrc eq "dl_dld.xs";
57
58# Initialise @dl_library_path with the 'standard' library path
59# for this platform as determined by Configure.
60
61120µs16µspush(@dl_library_path, split(' ', $Config::Config{libpth}));
# spent 6µs making 1 call to Config::FETCH
62
6317µs15µsmy $ldlibpthname = $Config::Config{ldlibpthname};
# spent 5µs making 1 call to Config::FETCH
6417µs14µsmy $ldlibpthname_defined = defined $Config::Config{ldlibpthname};
# spent 4µs making 1 call to Config::FETCH
6518µs14µsmy $pthsep = $Config::Config{path_sep};
# spent 4µs making 1 call to Config::FETCH
66
67# Add to @dl_library_path any extra directories we can gather from environment
68# during runtime.
69
7012µsif ($ldlibpthname_defined &&
71 exists $ENV{$ldlibpthname}) {
72 push(@dl_library_path, split(/$pthsep/, $ENV{$ldlibpthname}));
73}
74
75# E.g. HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH.
76
7712µsif ($ldlibpthname_defined &&
78 $ldlibpthname ne 'LD_LIBRARY_PATH' &&
79 exists $ENV{LD_LIBRARY_PATH}) {
80 push(@dl_library_path, split(/$pthsep/, $ENV{LD_LIBRARY_PATH}));
81}
82
83# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
84# NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB
8512µsboot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
86 !defined(&dl_error);
87
881700nsif ($dl_debug) {
89 print STDERR "DynaLoader.pm loaded (@INC, @dl_library_path)\n";
90 print STDERR "DynaLoader not linked into this perl\n"
91 unless defined(&boot_DynaLoader);
92}
93
94138µs1; # End of main code
95
96sub croak { require Carp; Carp::croak(@_) }
97
98sub bootstrap_inherit {
99 my $module = $_[0];
100 local *isa = *{"$module\::ISA"};
101 local @isa = (@isa, 'DynaLoader');
102 # Cannot goto due to delocalization. Will report errors on a wrong line?
103 bootstrap(@_);
104}
105
106# The bootstrap function cannot be autoloaded (without complications)
107# so we define it here:
108
109
# spent 8.85ms (1.79+7.05) within DynaLoader::bootstrap which was called 14 times, avg 632µs/call: # once (119µs+1.59ms) by DBI::install_driver at line 14 of DBD/mysql.pm # once (152µs+1.31ms) by XML::LibXML::BEGIN@28 at line 147 of XML/LibXML.pm # once (136µs+677µs) by MARC::Charset::BEGIN@10 at line 42 of Unicode/Normalize.pm # once (189µs+473µs) by C4::Members::BEGIN@42 at line 32 of Text/Unaccent.pm # once (164µs+414µs) by DBI::BEGIN@160 at line 258 of DBI.pm # once (113µs+449µs) by XML::LibXSLT::BEGIN@23 at line 38 of XML/LibXSLT.pm # once (158µs+314µs) by Math::BigInt::BEGIN@1 at line 16 of Math/BigInt/FastCalc.pm # once (99µs+325µs) by C4::Dates::BEGIN@29 at line 108 of Date/Calc.pm # once (116µs+289µs) by Template::Stash::XS::BEGIN@21 at line 26 of Template/Stash/XS.pm # once (111µs+287µs) by LWP::UserAgent::BEGIN@10 at line 67 of Storable.pm # once (121µs+240µs) by C4::Charset::BEGIN@24 at line 21 of Text/Iconv.pm # once (93µs+250µs) by C4::SQLHelper::BEGIN@23 at line 26 of List/MoreUtils.pm # once (106µs+228µs) by base::import at line 55 of Sub/Name.pm # once (118µs+209µs) by Text::CSV::BEGIN@1 at line 35 of Text/CSV_XS.pm
sub bootstrap {
110 # use local vars to enable $module.bs script to edit values
1111443µs local(@args) = @_;
1121420µs local($module) = $args[0];
1131419µs local(@dirs, $file);
114
115146µs unless ($module) {
116 require Carp;
117 Carp::confess("Usage: DynaLoader::bootstrap(module)");
118 }
119
120 # A common error on platforms which don't support dynamic loading.
121 # Since it's fatal and potentially confusing we give a detailed message.
1221423µs croak("Can't load module $module, dynamic loading not available in this perl.\n".
123 " (You may need to build a new perl executable which either supports\n".
124 " dynamic loading or has the $module module statically linked into it.)\n")
125 unless defined(&dl_load_file);
126
127
1281462µs my @modparts = split(/::/,$module);
1291420µs my $modfname = $modparts[-1];
130
131 # Some systems have restrictions on files names for DLL's etc.
132 # mod2fname returns appropriate file base name (typically truncated)
133 # It may also edit @modparts if required.
1341414µs $modfname = &mod2fname(\@modparts) if defined &mod2fname;
135
136
137
1381435µs my $modpname = join('/',@modparts);
139
1401413µs print STDERR "DynaLoader::bootstrap for $module ",
141 "(auto/$modpname/$modfname.$dl_dlext)\n"
142 if $dl_debug;
143
1441444µs foreach (@INC) {
145
146
1477669µs my $dir = "$_/auto/$modpname";
148
149
15076577µs76340µs next unless -d $dir; # skip over uninteresting directories
# spent 340µs making 76 calls to DynaLoader::CORE:ftdir, avg 4µs/call
151
152 # check for common cases to avoid autoload of dl_findfile
1531445µs my $try = "$dir/$modfname.$dl_dlext";
15414162µs1472µs last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try);
# spent 72µs making 14 calls to DynaLoader::CORE:ftfile, avg 5µs/call
155
156 # no luck here, save dir for possible later dl_findfile search
157 push @dirs, $dir;
158 }
159 # last resort, let dl_findfile have a go in all known locations
160148µs $file = dl_findfile(map("-L$_",@dirs,@INC), $modfname) unless $file;
161
162149µs croak("Can't locate loadable object for module $module in \@INC (\@INC contains: @INC)")
163 unless $file; # wording similar to error from 'require'
164
165
1661426µs my $bootname = "boot_$module";
16714123µs1467µs $bootname =~ s/\W/_/g;
# spent 67µs making 14 calls to DynaLoader::CORE:subst, avg 5µs/call
1681433µs @dl_require_symbols = ($bootname);
169
170 # Execute optional '.bootstrap' perl script for this module.
171 # The .bs file can be used to configure @dl_resolve_using etc to
172 # match the needs of the individual module on this architecture.
1731414µs my $bs = $file;
17414344µs14301µs $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
# spent 301µs making 14 calls to DynaLoader::CORE:subst, avg 21µs/call
17514110µs1468µs if (-s $bs) { # only read file if it's not empty
# spent 68µs making 14 calls to DynaLoader::CORE:ftsize, avg 5µs/call
176 print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug;
177 eval { do $bs; };
178 warn "$bs: $@\n" if $@;
179 }
180
1811410µs my $boot_symbol_ref;
182
183
184
185 # Many dynamic extension loading problems will appear to come from
186 # this section of code: XYZ failed at line 123 of DynaLoader.pm.
187 # Often these errors are actually occurring in the initialisation
188 # C code of the extension XS file. Perl reports the error as being
189 # in this perl code simply because this was the last perl code
190 # it executed.
191
192144.00ms283.79ms my $libref = dl_load_file($file, $module->dl_load_flags) or
# spent 3.74ms making 14 calls to DynaLoader::dl_load_file, avg 267µs/call # spent 46µs making 14 calls to DynaLoader::dl_load_flags, avg 3µs/call
193 croak("Can't load '$file' for module $module: ".dl_error());
194
1951428µs push(@dl_librefs,$libref); # record loaded object
196
19714125µs1444µs my @unresolved = dl_undef_symbols();
# spent 44µs making 14 calls to DynaLoader::dl_undef_symbols, avg 3µs/call
1981411µs if (@unresolved) {
199 require Carp;
200 Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
201 }
202
20314139µs1469µs $boot_symbol_ref = dl_find_symbol($libref, $bootname) or
# spent 69µs making 14 calls to DynaLoader::dl_find_symbol, avg 5µs/call
204 croak("Can't find '$bootname' symbol in $file\n");
205
2061424µs push(@dl_modules, $module); # record loaded module
207
20814269µs14163µs boot:
# spent 163µs making 14 calls to DynaLoader::dl_install_xsub, avg 12µs/call
209 my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
210
211 # See comment block above
212
2131421µs push(@dl_shared_objects, $file); # record files loaded
214
215142.37ms142.14ms &$xs(@args);
# spent 857µs making 1 call to XML::LibXML::bootstrap # spent 230µs making 1 call to DBI::bootstrap # spent 190µs making 1 call to XML::LibXSLT::bootstrap # spent 133µs making 1 call to DBD::mysql::bootstrap # spent 130µs making 1 call to Date::Calc::bootstrap # spent 116µs making 1 call to Template::Stash::XS::bootstrap # spent 90µs making 1 call to Storable::bootstrap # spent 82µs making 1 call to List::MoreUtils::bootstrap # spent 80µs making 1 call to Unicode::Normalize::bootstrap # spent 64µs making 1 call to Math::BigInt::FastCalc::bootstrap # spent 64µs making 1 call to Text::Unaccent::bootstrap # spent 50µs making 1 call to Text::Iconv::bootstrap # spent 30µs making 1 call to Text::CSV_XS::bootstrap # spent 24µs making 1 call to Sub::Name::bootstrap
216}
217
218#sub _check_file { # private utility to handle dl_expandspec vs -f tests
219# my($file) = @_;
220# return $file if (!$do_expand && -f $file); # the common case
221# return $file if ( $do_expand && ($file=dl_expandspec($file)));
222# return undef;
223#}
224
225# Let autosplit and the autoloader deal with these functions:
 
# spent 340µs within DynaLoader::CORE:ftdir which was called 76 times, avg 4µs/call: # 76 times (340µs+0s) by DynaLoader::bootstrap at line 150, avg 4µs/call
sub DynaLoader::CORE:ftdir; # opcode
# spent 72µs within DynaLoader::CORE:ftfile which was called 14 times, avg 5µs/call: # 14 times (72µs+0s) by DynaLoader::bootstrap at line 154, avg 5µs/call
sub DynaLoader::CORE:ftfile; # opcode
# spent 68µs within DynaLoader::CORE:ftsize which was called 14 times, avg 5µs/call: # 14 times (68µs+0s) by DynaLoader::bootstrap at line 175, avg 5µs/call
sub DynaLoader::CORE:ftsize; # opcode
# spent 368µs within DynaLoader::CORE:subst which was called 28 times, avg 13µs/call: # 14 times (301µs+0s) by DynaLoader::bootstrap at line 174, avg 21µs/call # 14 times (67µs+0s) by DynaLoader::bootstrap at line 167, avg 5µs/call
sub DynaLoader::CORE:subst; # opcode
# spent 69µs within DynaLoader::dl_find_symbol which was called 14 times, avg 5µs/call: # 14 times (69µs+0s) by DynaLoader::bootstrap at line 203, avg 5µs/call
sub DynaLoader::dl_find_symbol; # xsub
# spent 163µs within DynaLoader::dl_install_xsub which was called 14 times, avg 12µs/call: # 14 times (163µs+0s) by DynaLoader::bootstrap at line 208, avg 12µs/call
sub DynaLoader::dl_install_xsub; # xsub
# spent 3.74ms within DynaLoader::dl_load_file which was called 14 times, avg 267µs/call: # 14 times (3.74ms+0s) by DynaLoader::bootstrap at line 192, avg 267µs/call
sub DynaLoader::dl_load_file; # xsub
# spent 44µs within DynaLoader::dl_undef_symbols which was called 14 times, avg 3µs/call: # 14 times (44µs+0s) by DynaLoader::bootstrap at line 197, avg 3µs/call
sub DynaLoader::dl_undef_symbols; # xsub