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

Filename/usr/share/perl/5.10/FindBin.pm
StatementsExecuted 41 statements in 1.20ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11190µs260µsFindBin::::initFindBin::init
11136µs132µsFindBin::::BEGIN@95FindBin::BEGIN@95
11124µs128µsFindBin::::BEGIN@99FindBin::BEGIN@99
22119µs19µsFindBin::::CORE:ftfileFindBin::CORE:ftfile (opcode)
11117µs68µsFindBin::::BEGIN@98FindBin::BEGIN@98
11114µs14µsFindBin::::BEGIN@100FindBin::BEGIN@100
11113µs13µsFindBin::::CORE:readlinkFindBin::CORE:readlink (opcode)
1119µs269µsFindBin::::BEGIN@205FindBin::BEGIN@205
1114µs4µ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;
95397µs2228µs
# spent 132µs (36+96) within FindBin::BEGIN@95 which was called: # once (36µs+96µs) by C4::Auth_with_cas::BEGIN@28 at line 95
use Carp;
# spent 132µs making 1 call to FindBin::BEGIN@95 # spent 96µs making 1 call to Exporter::import
96118µsrequire 5.000;
9711µsrequire Exporter;
98351µs2120µs
# spent 68µs (17+52) within FindBin::BEGIN@98 which was called: # once (17µs+52µs) by C4::Auth_with_cas::BEGIN@28 at line 98
use Cwd qw(getcwd cwd abs_path);
# spent 68µs making 1 call to FindBin::BEGIN@98 # spent 52µs making 1 call to Exporter::import
99354µs2233µs
# spent 128µs (24+105) within FindBin::BEGIN@99 which was called: # once (24µs+105µs) by C4::Auth_with_cas::BEGIN@28 at line 99
use File::Basename;
# spent 128µs making 1 call to FindBin::BEGIN@99 # spent 104µs making 1 call to Exporter::import
1003755µs114µs
# spent 14µs within FindBin::BEGIN@100 which was called: # once (14µs+0s) by C4::Auth_with_cas::BEGIN@28 at line 100
use File::Spec;
# spent 14µs making 1 call to FindBin::BEGIN@100
101
10212µs@EXPORT_OK = qw($Bin $Script $RealBin $RealScript $Dir $RealDir);
10314µs%EXPORT_TAGS = (ALL => [qw($Bin $Script $RealBin $RealScript $Dir $RealDir)]);
104110µs@ISA = qw(Exporter);
105
1061400ns$VERSION = "1.50";
107
108
109# needed for VMS-specific filename translation
11011µ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 260µs (90+170) within FindBin::init which was called: # once (90µs+170µs) by FindBin::BEGIN@205 at line 205
{
12519153µs *Dir = \$Bin;
126 *RealDir = \$RealBin;
127
128 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
139 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');
149217µs unless(($script =~ m#/# || ($dosish && $script =~ m#\\#))
# spent 14µs making 1 call to FindBin::CORE:ftfile # spent 4µ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
17215µs croak("Cannot find current script '$0'") unless(-f $script);
# spent 5µs making 1 call to FindBin::CORE:ftfile
173
174 # Ensure $script contains the complete path in case we C<chdir>
175
176125µs $script = File::Spec->catfile(cwd2(), $script)
# spent 25µs making 1 call to File::Spec::Unix::file_name_is_absolute
177 unless File::Spec->file_name_is_absolute($script);
178
179155µs ($Script,$Bin) = fileparse($script);
# spent 55µs making 1 call to File::Basename::fileparse
180
181 # Resolve $script if it is a link
182 while(1)
183 {
184113µs my $linktext = readlink($script);
# spent 13µs making 1 call to FindBin::CORE:readlink
185
186119µs ($RealScript,$RealBin) = fileparse($script);
# spent 19µ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
195 if ($Bin) {
196 my $BinOld = $Bin;
197130µs $Bin = abs_path($Bin);
# spent 30µs making 1 call to Cwd::abs_path
198 defined $Bin or $Bin = File::Spec->canonpath($BinOld);
199 }
20017µs $RealBin = abs_path($RealBin) if($RealBin);
# spent 7µs making 1 call to Cwd::abs_path
201 }
202 }
203}
204
205145µs2528µs
# spent 269µs (9+260) within FindBin::BEGIN@205 which was called: # once (9µs+260µs) by C4::Auth_with_cas::BEGIN@28 at line 205
BEGIN { init }
# spent 269µs making 1 call to FindBin::BEGIN@205 # spent 260µs making 1 call to FindBin::init
206
20712µs*again = \&init;
208
20919µs1; # Keep require happy
 
# spent 19µs within FindBin::CORE:ftfile which was called 2 times, avg 9µs/call: # once (14µs+0s) by FindBin::init at line 149 # once (5µs+0s) by FindBin::init at line 172
sub FindBin::CORE:ftfile; # opcode
# spent 4µs within FindBin::CORE:match which was called: # once (4µs+0s) by FindBin::init at line 149
sub FindBin::CORE:match; # opcode
# spent 13µs within FindBin::CORE:readlink which was called: # once (13µs+0s) by FindBin::init at line 184
sub FindBin::CORE:readlink; # opcode