← 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:12:14 2013

Filename/usr/share/perl/5.10/AutoLoader.pm
StatementsExecuted 171 statements in 4.01ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
6641.11ms1.25msAutoLoader::::importAutoLoader::import
3331.06ms1.38msAutoLoader::::AUTOLOADAutoLoader::AUTOLOAD
311164µs327µsAutoLoader::::find_filenameAutoLoader::find_filename
721125µs125µsAutoLoader::::CORE:regcompAutoLoader::CORE:regcomp (opcode)
175177µs77µsAutoLoader::::CORE:substAutoLoader::CORE:subst (opcode)
31145µs45µsAutoLoader::::CORE:ftereadAutoLoader::CORE:fteread (opcode)
73138µs38µsAutoLoader::::CORE:matchAutoLoader::CORE:match (opcode)
11130µs30µsAutoLoader::::BEGIN@4AutoLoader::BEGIN@4
11128µs35µsAutoLoader::::BEGIN@3AutoLoader::BEGIN@3
142118µs18µsAutoLoader::::CORE:substcontAutoLoader::CORE:substcont (opcode)
11114µs36µsAutoLoader::::BEGIN@138AutoLoader::BEGIN@138
11114µs40µsAutoLoader::::BEGIN@186AutoLoader::BEGIN@186
11113µs28µsAutoLoader::::BEGIN@30AutoLoader::BEGIN@30
1119µs9µsAutoLoader::::BEGIN@13AutoLoader::BEGIN@13
1112µs2µsAutoLoader::::__ANON__[:31]AutoLoader::__ANON__[:31]
0000s0sAutoLoader::::unimportAutoLoader::unimport
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package AutoLoader;
2
3345µs242µs
# spent 35µs (28+7) within AutoLoader::BEGIN@3 which was called: # once (28µs+7µs) by Storable::BEGIN@22 at line 3
use strict;
# spent 35µs making 1 call to AutoLoader::BEGIN@3 # spent 7µs making 1 call to strict::import
43125µs130µs
# spent 30µs within AutoLoader::BEGIN@4 which was called: # once (30µs+0s) by Storable::BEGIN@22 at line 4
use 5.006_001;
# spent 30µs making 1 call to AutoLoader::BEGIN@4
5
61700nsour($VERSION, $AUTOLOAD);
7
81400nsmy $is_dosish;
91200nsmy $is_epoc;
101100nsmy $is_vms;
111100nsmy $is_macos;
12
13
# spent 9µs within AutoLoader::BEGIN@13 which was called: # once (9µs+0s) by Storable::BEGIN@22 at line 19
BEGIN {
1413µs $is_dosish = $^O eq 'dos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'NetWare';
151400ns $is_epoc = $^O eq 'epoc';
161400ns $is_vms = $^O eq 'VMS';
171400ns $is_macos = $^O eq 'MacOS';
1816µs $VERSION = '5.68';
191164µs19µs}
# spent 9µs making 1 call to AutoLoader::BEGIN@13
20
21
# spent 1.38ms (1.06+327µs) within AutoLoader::AUTOLOAD which was called 3 times, avg 461µs/call: # once (670µs+85µs) by POSIX::import at line 44 of POSIX.pm # once (251µs+133µs) by Cache::Memcached::__ANON__[/usr/share/perl5/Cache/Memcached.pm:714] at line 706 of Cache/Memcached.pm # once (136µs+110µs) by C4::XSLT::XSLTParse4Display at line 228 of /usr/share/koha/lib/C4/XSLT.pm
AUTOLOAD {
2234µs my $sub = $AUTOLOAD;
23312µs3327µs my $filename = AutoLoader::find_filename( $sub );
# spent 327µs making 3 calls to AutoLoader::find_filename, avg 109µs/call
24
2532µs my $save = $@;
26325µs local $!; # Do not munge the value.
279949µs eval { local $SIG{__DIE__}; require $filename };
2832µs if ($@) {
2913µs if (substr($sub,-9) eq '::DESTROY') {
303595µs244µs
# spent 28µs (13+15) within AutoLoader::BEGIN@30 which was called: # once (13µs+15µs) by Storable::BEGIN@22 at line 30
no strict 'refs';
# spent 28µs making 1 call to AutoLoader::BEGIN@30 # spent 15µs making 1 call to strict::unimport
31215µs
# spent 2µs within AutoLoader::__ANON__[/usr/share/perl/5.10/AutoLoader.pm:31] which was called: # once (2µs+0s) by C4::XSLT::XSLTParse4Display at line 51
*$sub = sub {};
321900ns $@ = undef;
33 } elsif ($@ =~ /^Can't locate/) {
34 # The load might just have failed because the filename was too
35 # long for some old SVR3 systems which treat long names as errors.
36 # If we can successfully truncate a long name then it's worth a go.
37 # There is a slight risk that we could pick up the wrong file here
38 # but autosplit should have warned about that when splitting.
39 if ($filename =~ s/(\w{12,})\.al$/substr($1,0,11).".al"/e){
40 eval { local $SIG{__DIE__}; require $filename };
41 }
42 }
431400ns if ($@){
44 $@ =~ s/ at .*\n//;
45 my $error = $@;
46 require Carp;
47 Carp::croak($error);
48 }
49 }
5032µs $@ = $save;
51351µs3814µs goto &$sub;
# spent 636µs making 1 call to POSIX::load_imports # spent 176µs making 1 call to Storable::thaw # spent 2µs making 1 call to AutoLoader::__ANON__[AutoLoader.pm:31]
52}
53
54
# spent 327µs (164+163) within AutoLoader::find_filename which was called 3 times, avg 109µs/call: # 3 times (164µs+163µs) by AutoLoader::AUTOLOAD at line 23, avg 109µs/call
sub find_filename {
5534µs my $sub = shift;
5631µs my $filename;
57 # Braces used to preserve $1 et al.
58 {
59 # Try to find the autoloaded file from the package-qualified
60 # name of the sub. e.g., if the sub needed is
61 # Getopt::Long::GetOptions(), then $INC{Getopt/Long.pm} is
62 # something like '/usr/lib/perl5/Getopt/Long.pm', and the
63 # autoload file is '/usr/lib/perl5/auto/Getopt/Long/GetOptions.al'.
64 #
65 # However, if @INC is a relative path, this might not work. If,
66 # for example, @INC = ('lib'), then $INC{Getopt/Long.pm} is
67 # 'lib/Getopt/Long.pm', and we want to require
68 # 'auto/Getopt/Long/GetOptions.al' (without the leading 'lib').
69 # In this case, we simple prepend the 'auto/' and let the
70 # C<require> take care of the searching for us.
71
72660µs327µs my ($pkg,$func) = ($sub =~ /(.*)::([^:]+)$/);
# spent 27µs making 3 calls to AutoLoader::CORE:match, avg 9µs/call
73328µs39µs $pkg =~ s#::#/#g;
# spent 9µs making 3 calls to AutoLoader::CORE:subst, avg 3µs/call
74313µs if (defined($filename = $INC{"$pkg.pm"})) {
7535µs if ($is_macos) {
76 $pkg =~ tr#/#:#;
77 $filename = undef
78 unless $filename =~ s#^(.*)$pkg\.pm\z#$1auto:$pkg:$func.al#s;
79 } else {
803122µs1275µs $filename = undef
# spent 56µs making 3 calls to AutoLoader::CORE:regcomp, avg 19µs/call # spent 13µs making 3 calls to AutoLoader::CORE:subst, avg 4µs/call # spent 7µs making 6 calls to AutoLoader::CORE:substcont, avg 1µs/call
81 unless $filename =~ s#^(.*)$pkg\.pm\z#$1auto/$pkg/$func.al#s;
82 }
83
84 # if the file exists, then make sure that it is a
85 # a fully anchored path (i.e either '/usr/lib/auto/foo/bar.al',
86 # or './lib/auto/foo/bar.al'. This avoids C<require> searching
87 # (and failing) to find the 'lib/auto/foo/bar.al' because it
88 # looked for 'lib/lib/auto/foo/bar.al', given @INC = ('lib').
89
90359µs345µs if (defined $filename and -r $filename) {
# spent 45µs making 3 calls to AutoLoader::CORE:fteread, avg 15µs/call
9129µs24µs unless ($filename =~ m|^/|s) {
# spent 4µs making 2 calls to AutoLoader::CORE:match, avg 2µs/call
92 if ($is_dosish) {
93 unless ($filename =~ m{^([a-z]:)?[\\/]}is) {
94 if ($^O ne 'NetWare') {
95 $filename = "./$filename";
96 } else {
97 $filename = "$filename";
98 }
99 }
100 }
101 elsif ($is_epoc) {
102 unless ($filename =~ m{^([a-z?]:)?[\\/]}is) {
103 $filename = "./$filename";
104 }
105 }
106 elsif ($is_vms) {
107 # XXX todo by VMSmiths
108 $filename = "./$filename";
109 }
110 elsif (!$is_macos) {
111 $filename = "./$filename";
112 }
113 }
114 }
115 else {
11611µs $filename = undef;
117 }
118 }
11933µs unless (defined $filename) {
120 # let C<require> do the searching
12112µs $filename = "auto/$sub.al";
12218µs14µs $filename =~ s#::#/#g;
# spent 4µs making 1 call to AutoLoader::CORE:subst
123 }
124 }
125312µs return $filename;
126}
127
128
# spent 1.25ms (1.11+141µs) within AutoLoader::import which was called 6 times, avg 209µs/call: # once (696µs+22µs) by POSIX::BEGIN@9 at line 9 of POSIX.pm # once (171µs+23µs) by Storable::BEGIN@22 at line 22 of Storable.pm # once (111µs+45µs) by Compress::Zlib::BEGIN@6 at line 6 of Compress/Zlib.pm # once (98µs+39µs) by Compress::Raw::Zlib::BEGIN@6 at line 6 of Compress/Raw/Zlib.pm # once (21µs+7µs) by POSIX::SigAction::BEGIN@58 at line 58 of POSIX.pm # once (14µs+4µs) by POSIX::SigRt::BEGIN@62 at line 62 of POSIX.pm
sub import {
12967µs my $pkg = shift;
13066µs my $callpkg = caller;
131
132 #
133 # Export symbols, but not by accident of inheritance.
134 #
135
13669µs if ($pkg eq 'AutoLoader') {
137622µs27µs if ( @_ and $_[0] =~ /^&?AUTOLOAD$/ ) {
# spent 7µs making 2 calls to AutoLoader::CORE:match, avg 3µs/call
1383302µs258µs
# spent 36µs (14+22) within AutoLoader::BEGIN@138 which was called: # once (14µs+22µs) by Storable::BEGIN@22 at line 138
no strict 'refs';
# spent 36µs making 1 call to AutoLoader::BEGIN@138 # spent 22µs making 1 call to strict::unimport
13929µs *{ $callpkg . '::AUTOLOAD' } = \&AUTOLOAD;
140 }
141 }
142
143 #
144 # Try to find the autosplit index file. Eg., if the call package
145 # is POSIX, then $INC{POSIX.pm} is something like
146 # '/usr/local/lib/perl5/POSIX.pm', and the autosplit index file is in
147 # '/usr/local/lib/perl5/auto/POSIX/autosplit.ix', so we require that.
148 #
149 # However, if @INC is a relative path, this might not work. If,
150 # for example, @INC = ('lib'), then
151 # $INC{POSIX.pm} is 'lib/POSIX.pm', and we want to require
152 # 'auto/POSIX/autosplit.ix' (without the leading 'lib').
153 #
154
155656µs625µs (my $calldir = $callpkg) =~ s#::#/#g;
# spent 25µs making 6 calls to AutoLoader::CORE:subst, avg 4µs/call
156612µs my $path = $INC{$calldir . '.pm'};
157638µs if (defined($path)) {
158 # Try absolute path name, but only eval it if the
159 # transformation from module path to autosplit.ix path
160 # succeeded!
16142µs my $replaced_okay;
16244µs if ($is_macos) {
163 (my $malldir = $calldir) =~ tr#/#:#;
164 $replaced_okay = ($path =~ s#^(.*)$malldir\.pm\z#$1auto:$malldir:autosplit.ix#s);
165 } else {
1664202µs16109µs $replaced_okay = ($path =~ s#^(.*)$calldir\.pm\z#$1auto/$calldir/autosplit.ix#);
# spent 70µs making 4 calls to AutoLoader::CORE:regcomp, avg 17µs/call # spent 28µs making 4 calls to AutoLoader::CORE:subst, avg 7µs/call # spent 12µs making 8 calls to AutoLoader::CORE:substcont, avg 1µs/call
167 }
168
1698886µs eval { require $path; } if $replaced_okay;
170 # If that failed, try relative path with normal @INC searching.
17144µs if (!$replaced_okay or $@) {
172 $path ="auto/$calldir/autosplit.ix";
173 eval { require $path; };
174 }
17544µs if ($@) {
176 my $error = $@;
177 require Carp;
178 Carp::carp($error);
179 }
180 }
181}
182
183sub unimport {
184 my $callpkg = caller;
185
1863103µs266µs
# spent 40µs (14+26) within AutoLoader::BEGIN@186 which was called: # once (14µs+26µs) by Storable::BEGIN@22 at line 186
no strict 'refs';
# spent 40µs making 1 call to AutoLoader::BEGIN@186 # spent 26µs making 1 call to strict::unimport
187
188 for my $exported (qw( AUTOLOAD )) {
189 my $symname = $callpkg . '::' . $exported;
190 undef *{ $symname } if \&{ $symname } == \&{ $exported };
191 *{ $symname } = \&{ $symname };
192 }
193}
194
19514µs1;
196
197__END__
 
# spent 45µs within AutoLoader::CORE:fteread which was called 3 times, avg 15µs/call: # 3 times (45µs+0s) by AutoLoader::find_filename at line 90, avg 15µs/call
sub AutoLoader::CORE:fteread; # opcode
# spent 38µs within AutoLoader::CORE:match which was called 7 times, avg 5µs/call: # 3 times (27µs+0s) by AutoLoader::find_filename at line 72, avg 9µs/call # 2 times (7µs+0s) by AutoLoader::import at line 137, avg 3µs/call # 2 times (4µs+0s) by AutoLoader::find_filename at line 91, avg 2µs/call
sub AutoLoader::CORE:match; # opcode
# spent 125µs within AutoLoader::CORE:regcomp which was called 7 times, avg 18µs/call: # 4 times (70µs+0s) by AutoLoader::import at line 166, avg 17µs/call # 3 times (56µs+0s) by AutoLoader::find_filename at line 80, avg 19µs/call
sub AutoLoader::CORE:regcomp; # opcode
# spent 77µs within AutoLoader::CORE:subst which was called 17 times, avg 5µs/call: # 6 times (25µs+0s) by AutoLoader::import at line 155, avg 4µs/call # 4 times (28µs+0s) by AutoLoader::import at line 166, avg 7µs/call # 3 times (13µs+0s) by AutoLoader::find_filename at line 80, avg 4µs/call # 3 times (9µs+0s) by AutoLoader::find_filename at line 73, avg 3µs/call # once (4µs+0s) by AutoLoader::find_filename at line 122
sub AutoLoader::CORE:subst; # opcode
# spent 18µs within AutoLoader::CORE:substcont which was called 14 times, avg 1µs/call: # 8 times (12µs+0s) by AutoLoader::import at line 166, avg 1µs/call # 6 times (7µs+0s) by AutoLoader::find_filename at line 80, avg 1µs/call
sub AutoLoader::CORE:substcont; # opcode