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

Filename/usr/share/perl/5.10/FindBin.pm
StatementsExecuted 41 statements in 1.07ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11170µs216µsFindBin::::initFindBin::init
11137µs122µsFindBin::::BEGIN@98FindBin::BEGIN@98
11135µs142µsFindBin::::BEGIN@99FindBin::BEGIN@99
11134µs142µsFindBin::::BEGIN@95FindBin::BEGIN@95
11121µs23µsFindBin::::BEGIN@100FindBin::BEGIN@100
22112µs12µsFindBin::::CORE:ftfileFindBin::CORE:ftfile (opcode)
11111µs11µsFindBin::::CORE:readlinkFindBin::CORE:readlink (opcode)
11110µs227µsFindBin::::BEGIN@205FindBin::BEGIN@205
1112µs2µsFindBin::::CORE:matchFindBin::CORE:match (opcode)
0000s0sFindBin::::cwd2FindBin::cwd2
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# FindBin.pm
2#
3# Copyright (c) 1995 Graham Barr & Nick Ing-Simmons. All rights reserved.
4# This program is free software; you can redistribute it and/or modify it
5# under the same terms as Perl itself.
6
7=head1 NAME
8
- -
94package FindBin;
95373µs2250µs
# spent 142µs (34+108) within FindBin::BEGIN@95 which was called: # once (34µs+108µs) by C4::Auth_with_cas::BEGIN@28 at line 95
use Carp;
# spent 142µs making 1 call to FindBin::BEGIN@95 # spent 108µs making 1 call to Exporter::import
96116µsrequire 5.000;
971900nsrequire Exporter;
98372µs2207µs
# spent 122µs (37+85) within FindBin::BEGIN@98 which was called: # once (37µs+85µs) by C4::Auth_with_cas::BEGIN@28 at line 98
use Cwd qw(getcwd cwd abs_path);
# spent 122µs making 1 call to FindBin::BEGIN@98 # spent 85µs making 1 call to Exporter::import
99363µs2248µs
# spent 142µs (35+107) within FindBin::BEGIN@99 which was called: # once (35µs+107µs) by C4::Auth_with_cas::BEGIN@28 at line 99
use File::Basename;
# spent 142µs making 1 call to FindBin::BEGIN@99 # spent 107µs making 1 call to Exporter::import
1003620µs225µs
# spent 23µs (21+2) within FindBin::BEGIN@100 which was called: # once (21µs+2µs) by C4::Auth_with_cas::BEGIN@28 at line 100
use File::Spec;
# spent 23µs making 1 call to FindBin::BEGIN@100 # spent 2µs making 1 call to UNIVERSAL::import
101
10212µs@EXPORT_OK = qw($Bin $Script $RealBin $RealScript $Dir $RealDir);
10313µs%EXPORT_TAGS = (ALL => [qw($Bin $Script $RealBin $RealScript $Dir $RealDir)]);
104121µs@ISA = qw(Exporter);
105
1061500ns$VERSION = "1.50";
107
108
109# needed for VMS-specific filename translation
11012µsif( $^O eq 'VMS' ) {
111 require VMS::Filespec;
112 VMS::Filespec->import;
113}
114
115sub cwd2 {
116 my $cwd = getcwd();
117 # getcwd might fail if it hasn't access to the current directory.
118 # try harder.
119 defined $cwd or $cwd = cwd();
120 $cwd;
121}
122
123sub init
124
# spent 216µs (70+146) within FindBin::init which was called: # once (70µs+146µs) by FindBin::BEGIN@205 at line 205
{
12537µs *Dir = \$Bin;
126 *RealDir = \$RealBin;
127
12822µs if($0 eq '-e' || $0 eq '-')
129 {
130 # perl invoked with -e or script is on C<STDIN>
131 $Script = $RealScript = $0;
132 $Bin = $RealBin = cwd2();
133 $Bin = VMS::Filespec::unixify($Bin) if $^O eq 'VMS';
134 }
135 else
136 {
137 my $script = $0;
138
139861µs if ($^O eq 'VMS')
140 {
141 ($Bin,$Script) = VMS::Filespec::rmsexpand($0) =~ /(.*[\]>\/]+)(.*)/s;
142 # C<use disk:[dev]/lib> isn't going to work, so unixify first
143 ($Bin = VMS::Filespec::unixify($Bin)) =~ s/\/\z//;
144 ($RealBin,$RealScript) = ($Bin,$Script);
145 }
146 else
147 {
148 my $dosish = ($^O eq 'MSWin32' or $^O eq 'os2');
149212µs unless(($script =~ m#/# || ($dosish && $script =~ m#\\#))
# spent 10µs making 1 call to FindBin::CORE:ftfile # spent 2µs making 1 call to FindBin::CORE:match
150 && -f $script)
151 {
152 my $dir;
153 foreach $dir (File::Spec->path)
154 {
155 my $scr = File::Spec->catfile($dir, $script);
156
157 # $script can been found via PATH but perl could have
158 # been invoked as 'perl file'. Do a dumb check to see
159 # if $script is a perl program, if not then keep $script = $0
160 #
161 # well we actually only check that it is an ASCII file
162 # we know its executable so it is probably a script
163 # of some sort.
164 if(-f $scr && -r _ && ($dosish || -x _) && -s _ && -T _)
165 {
166 $script = $scr;
167 last;
168 }
169 }
170 }
171
17212µs croak("Cannot find current script '$0'") unless(-f $script);
# spent 2µs making 1 call to FindBin::CORE:ftfile
173
174 # Ensure $script contains the complete path in case we C<chdir>
175
176116µs $script = File::Spec->catfile(cwd2(), $script)
# spent 16µs making 1 call to File::Spec::Unix::file_name_is_absolute
177 unless File::Spec->file_name_is_absolute($script);
178
179138µs ($Script,$Bin) = fileparse($script);
# spent 38µs making 1 call to File::Basename::fileparse
180
181 # Resolve $script if it is a link
182 while(1)
183 {
184321µs111µs my $linktext = readlink($script);
# spent 11µs making 1 call to FindBin::CORE:readlink
185
186114µs ($RealScript,$RealBin) = fileparse($script);
# spent 14µs making 1 call to File::Basename::fileparse
187 last unless defined $linktext;
188
189 $script = (File::Spec->file_name_is_absolute($linktext))
190 ? $linktext
191 : File::Spec->catfile($RealBin, $linktext);
192 }
193
194 # Get absolute paths to directories
195354µs if ($Bin) {
196 my $BinOld = $Bin;
197139µs $Bin = abs_path($Bin);
# spent 39µs making 1 call to Cwd::abs_path
198 defined $Bin or $Bin = File::Spec->canonpath($BinOld);
199 }
200113µs $RealBin = abs_path($RealBin) if($RealBin);
# spent 13µs making 1 call to Cwd::abs_path
201 }
202 }
203}
204
205144µs2443µs
# spent 227µs (10+216) within FindBin::BEGIN@205 which was called: # once (10µs+216µs) by C4::Auth_with_cas::BEGIN@28 at line 205
BEGIN { init }
# spent 227µs making 1 call to FindBin::BEGIN@205 # spent 216µs making 1 call to FindBin::init
206
20712µs*again = \&init;
208
20919µs1; # Keep require happy
 
# spent 12µs within FindBin::CORE:ftfile which was called 2 times, avg 6µs/call: # once (10µs+0s) by FindBin::init at line 149 # once (2µs+0s) by FindBin::init at line 172
sub FindBin::CORE:ftfile; # opcode
# spent 2µs within FindBin::CORE:match which was called: # once (2µs+0s) by FindBin::init at line 149
sub FindBin::CORE:match; # opcode
# spent 11µs within FindBin::CORE:readlink which was called: # once (11µs+0s) by FindBin::init at line 184
sub FindBin::CORE:readlink; # opcode