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

Filename/usr/share/perl5/Net/LDAP/Constant.pm
StatementsExecuted 2048 statements in 6.40ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
156431747µs747µsNet::LDAP::Constant::::CORE:matchNet::LDAP::Constant::CORE:match (opcode)
52221341µs341µsNet::LDAP::Constant::::CORE:readlineNet::LDAP::Constant::CORE:readline (opcode)
11123µs34µsNet::LDAP::Constant::::BEGIN@9Net::LDAP::Constant::BEGIN@9
0000s0sNet::LDAP::Constant::::__ANON__[:19]Net::LDAP::Constant::__ANON__[:19]
0000s0sNet::LDAP::Util::::ldap_error_name Net::LDAP::Util::ldap_error_name
0000s0sNet::LDAP::Util::::ldap_error_text Net::LDAP::Util::ldap_error_text
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# Copyright (c) 1998-2009 Graham Barr <gbarr@pobox.com>. All rights reserved.
2# This program is free software; you can redistribute it and/or
3# modify it under the same terms as Perl itself.
4
5package Net::LDAP::Constant;
6
71600ns$VERSION = "0.08";
8
93408µs245µs
# spent 34µs (23+11) within Net::LDAP::Constant::BEGIN@9 which was called: # once (23µs+11µs) by Net::LDAP::Message::BEGIN@7 at line 9
use Exporter qw(import);
# spent 34µs making 1 call to Net::LDAP::Constant::BEGIN@9 # spent 11µs making 1 call to Exporter::import
10
111300nsmy @err2name;
12
131400nslocal $_;
141895µs403235µswhile(<DATA>) {
# spent 235µs making 403 calls to Net::LDAP::Constant::CORE:readline, avg 584ns/call
15522911µs522194µs last if /^=cut/;
# spent 194µs making 522 calls to Net::LDAP::Constant::CORE:match, avg 372ns/call
165211.04ms521149µs my $protocol_const = /^=head2 Protocol Constants/ ... /^=head2/;
# spent 149µs making 521 calls to Net::LDAP::Constant::CORE:match, avg 286ns/call
175211.31ms521404µs next unless /^=item\s+(LDAP_\S+)\s+\((.*)\)/;
# spent 404µs making 521 calls to Net::LDAP::Constant::CORE:match, avg 776ns/call
18119197µs my ($name, $value) = ($1,$2);
19119986µs *{$name} = sub () { $value };
2011991µs push @EXPORT_OK, $name;
21119552µs119106µs $err2name[$value] = $name if $protocol_const;
# spent 106µs making 119 calls to Net::LDAP::Constant::CORE:readline, avg 892ns/call
22}
23
24
25# These subs are really in Net::LDAP::Util, but need to access <DATA>
26# so its easier for them to be here.
27
28
29sub Net::LDAP::Util::ldap_error_name {
30 my $code = 0 + (ref($_[0]) ? $_[0]->code : $_[0]);
31
32 $err2name[$code] || sprintf("LDAP error code %d(0x%02X)",$code,$code);
33}
34
35
36sub Net::LDAP::Util::ldap_error_text {
37 my $code = 0 + (ref($_[0]) ? $_[0]->code : $_[0]);
38 my $text;
39
40 seek(DATA,0,0);
41 local $/=''; # paragraph mode
42 local $_;
43 my $n = -1;
44 while(<DATA>) {
45 last if /^=head2/ and ++$n;
46 last if /^=cut/;
47 next if $n;
48 if (/^=item\s+(LDAP_\S+)\s+\((\d+)\)/) {
49 last if defined $text;
50 $text = '' if $2 == $code;
51 }
52 elsif (defined $text) {
53 $text .= $_;
54 }
55 }
56
57 if (defined $text) {
58 # Do some cleanup. Really should use a proper pod parser here.
59
60 $text =~ s/^=item\s+\*\s+/ * /msg;
61 $text =~ s/^=(over\s*\d*|back)//msg;
62 $text =~ s/ +\n//g;
63 $text =~ s/\n\n+/\n\n/g;
64 $text =~ s/\n+\Z/\n/ if defined $text;
65 }
66
67 return $text;
68}
69
70117µs1;
71
72__DATA__
 
# spent 747µs within Net::LDAP::Constant::CORE:match which was called 1564 times, avg 478ns/call: # 522 times (194µs+0s) by Net::LDAP::Message::BEGIN@7 at line 15, avg 372ns/call # 521 times (404µs+0s) by Net::LDAP::Message::BEGIN@7 at line 17, avg 776ns/call # 521 times (149µs+0s) by Net::LDAP::Message::BEGIN@7 at line 16, avg 286ns/call
sub Net::LDAP::Constant::CORE:match; # opcode
# spent 341µs within Net::LDAP::Constant::CORE:readline which was called 522 times, avg 654ns/call: # 403 times (235µs+0s) by Net::LDAP::Message::BEGIN@7 at line 14, avg 584ns/call # 119 times (106µs+0s) by Net::LDAP::Message::BEGIN@7 at line 21, avg 892ns/call
sub Net::LDAP::Constant::CORE:readline; # opcode