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

Filename/usr/share/perl5/Net/LDAP/Constant.pm
StatementsExecuted 2048 statements in 8.39ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1564311.07ms1.07msNet::LDAP::Constant::::CORE:matchNet::LDAP::Constant::CORE:match (opcode)
52221472µs472µsNet::LDAP::Constant::::CORE:readlineNet::LDAP::Constant::CORE:readline (opcode)
11128µs40µ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
93409µs251µs
# spent 40µs (28+12) within Net::LDAP::Constant::BEGIN@9 which was called: # once (28µs+12µs) by Net::LDAP::Message::BEGIN@7 at line 9
use Exporter qw(import);
# spent 40µs making 1 call to Net::LDAP::Constant::BEGIN@9 # spent 12µs making 1 call to Exporter::import
10
111300nsmy @err2name;
12
131300nslocal $_;
1411.16ms403315µswhile(<DATA>) {
# spent 315µs making 403 calls to Net::LDAP::Constant::CORE:readline, avg 782ns/call
155221.23ms522303µs last if /^=cut/;
# spent 303µs making 522 calls to Net::LDAP::Constant::CORE:match, avg 580ns/call
165211.24ms521188µs my $protocol_const = /^=head2 Protocol Constants/ ... /^=head2/;
# spent 188µs making 521 calls to Net::LDAP::Constant::CORE:match, avg 361ns/call
175211.69ms521574µs next unless /^=item\s+(LDAP_\S+)\s+\((.*)\)/;
# spent 574µs making 521 calls to Net::LDAP::Constant::CORE:match, avg 1µs/call
18119361µs my ($name, $value) = ($1,$2);
191191.38ms *{$name} = sub () { $value };
20119142µs push @EXPORT_OK, $name;
21119760µs119157µs $err2name[$value] = $name if $protocol_const;
# spent 157µs making 119 calls to Net::LDAP::Constant::CORE:readline, avg 1µs/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
70124µs1;
71
72__DATA__
 
# spent 1.07ms within Net::LDAP::Constant::CORE:match which was called 1564 times, avg 681ns/call: # 522 times (303µs+0s) by Net::LDAP::Message::BEGIN@7 at line 15, avg 580ns/call # 521 times (574µs+0s) by Net::LDAP::Message::BEGIN@7 at line 17, avg 1µs/call # 521 times (188µs+0s) by Net::LDAP::Message::BEGIN@7 at line 16, avg 361ns/call
sub Net::LDAP::Constant::CORE:match; # opcode
# spent 472µs within Net::LDAP::Constant::CORE:readline which was called 522 times, avg 905ns/call: # 403 times (315µs+0s) by Net::LDAP::Message::BEGIN@7 at line 14, avg 782ns/call # 119 times (157µs+0s) by Net::LDAP::Message::BEGIN@7 at line 21, avg 1µs/call
sub Net::LDAP::Constant::CORE:readline; # opcode