← 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:02:01 2013

Filename/usr/share/perl5/HTTP/Status.pm
StatementsExecuted 282 statements in 2.78ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1661180µs80µsHTTP::Status::::CORE:matchHTTP::Status::CORE:match (opcode)
11117µs21µsHTTP::Status::::BEGIN@3HTTP::Status::BEGIN@3
1119µs81µsHTTP::Status::::BEGIN@6HTTP::Status::BEGIN@6
0000s0sHTTP::Status::::is_client_errorHTTP::Status::is_client_error
0000s0sHTTP::Status::::is_errorHTTP::Status::is_error
0000s0sHTTP::Status::::is_infoHTTP::Status::is_info
0000s0sHTTP::Status::::is_redirectHTTP::Status::is_redirect
0000s0sHTTP::Status::::is_server_errorHTTP::Status::is_server_error
0000s0sHTTP::Status::::is_successHTTP::Status::is_success
0000s0sHTTP::Status::::status_messageHTTP::Status::status_message
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package HTTP::Status;
2
3345µs225µs
# spent 21µs (17+4) within HTTP::Status::BEGIN@3 which was called: # once (17µs+4µs) by LWP::Simple::BEGIN@14 at line 3
use strict;
# spent 21µs making 1 call to HTTP::Status::BEGIN@3 # spent 4µs making 1 call to strict::import
4155µsrequire 5.002; # because we use prototypes
5
63542µs2153µs
# spent 81µs (9+72) within HTTP::Status::BEGIN@6 which was called: # once (9µs+72µs) by LWP::Simple::BEGIN@14 at line 6
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);
# spent 81µs making 1 call to HTTP::Status::BEGIN@6 # spent 72µs making 1 call to vars::import
7
81900nsrequire Exporter;
9110µs@ISA = qw(Exporter);
1011µs@EXPORT = qw(is_info is_success is_redirect is_error status_message);
111700ns@EXPORT_OK = qw(is_client_error is_server_error);
121400ns$VERSION = "5.817";
13
14# Note also addition of mnemonics to @EXPORT below
15
16# Unmarked codes are from RFC 2616
17# See also: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
18
19144µsmy %StatusCode = (
20 100 => 'Continue',
21 101 => 'Switching Protocols',
22 102 => 'Processing', # RFC 2518 (WebDAV)
23 200 => 'OK',
24 201 => 'Created',
25 202 => 'Accepted',
26 203 => 'Non-Authoritative Information',
27 204 => 'No Content',
28 205 => 'Reset Content',
29 206 => 'Partial Content',
30 207 => 'Multi-Status', # RFC 2518 (WebDAV)
31 300 => 'Multiple Choices',
32 301 => 'Moved Permanently',
33 302 => 'Found',
34 303 => 'See Other',
35 304 => 'Not Modified',
36 305 => 'Use Proxy',
37 307 => 'Temporary Redirect',
38 400 => 'Bad Request',
39 401 => 'Unauthorized',
40 402 => 'Payment Required',
41 403 => 'Forbidden',
42 404 => 'Not Found',
43 405 => 'Method Not Allowed',
44 406 => 'Not Acceptable',
45 407 => 'Proxy Authentication Required',
46 408 => 'Request Timeout',
47 409 => 'Conflict',
48 410 => 'Gone',
49 411 => 'Length Required',
50 412 => 'Precondition Failed',
51 413 => 'Request Entity Too Large',
52 414 => 'Request-URI Too Large',
53 415 => 'Unsupported Media Type',
54 416 => 'Request Range Not Satisfiable',
55 417 => 'Expectation Failed',
56 422 => 'Unprocessable Entity', # RFC 2518 (WebDAV)
57 423 => 'Locked', # RFC 2518 (WebDAV)
58 424 => 'Failed Dependency', # RFC 2518 (WebDAV)
59 425 => 'No code', # WebDAV Advanced Collections
60 426 => 'Upgrade Required', # RFC 2817
61 449 => 'Retry with', # unofficial Microsoft
62 500 => 'Internal Server Error',
63 501 => 'Not Implemented',
64 502 => 'Bad Gateway',
65 503 => 'Service Unavailable',
66 504 => 'Gateway Timeout',
67 505 => 'HTTP Version Not Supported',
68 506 => 'Variant Also Negotiates', # RFC 2295
69 507 => 'Insufficient Storage', # RFC 2518 (WebDAV)
70 509 => 'Bandwidth Limit Exceeded', # unofficial
71 510 => 'Not Extended', # RFC 2774
72);
73
741700nsmy $mnemonicCode = '';
751400nsmy ($code, $message);
7615µswhile (($code, $message) = each %StatusCode) {
77 # create mnemonic subroutines
785216µs $message =~ tr/a-z \-/A-Z__/;
795233µs $mnemonicCode .= "sub HTTP_$message () { $code }\n";
805231µs $mnemonicCode .= "*RC_$message = \\&HTTP_$message;\n"; # legacy
815226µs $mnemonicCode .= "push(\@EXPORT_OK, 'HTTP_$message');\n";
825259µs $mnemonicCode .= "push(\@EXPORT, 'RC_$message');\n";
83}
8411.53mseval $mnemonicCode; # only one eval for speed
# spent 155µs executing statements in string eval
851800nsdie if $@;
86
87# backwards compatibility
8813µs*RC_MOVED_TEMPORARILY = \&RC_FOUND; # 302 was renamed in the standard
8915µspush(@EXPORT, "RC_MOVED_TEMPORARILY");
90
911327µs16680µs%EXPORT_TAGS = (
# spent 80µs making 166 calls to HTTP::Status::CORE:match, avg 483ns/call
92 constants => [grep /^HTTP_/, @EXPORT_OK],
93 is => [grep /^is_/, @EXPORT, @EXPORT_OK],
94);
95
96
97sub status_message ($) { $StatusCode{$_[0]}; }
98
99sub is_info ($) { $_[0] >= 100 && $_[0] < 200; }
100sub is_success ($) { $_[0] >= 200 && $_[0] < 300; }
101sub is_redirect ($) { $_[0] >= 300 && $_[0] < 400; }
102sub is_error ($) { $_[0] >= 400 && $_[0] < 600; }
103sub is_client_error ($) { $_[0] >= 400 && $_[0] < 500; }
104sub is_server_error ($) { $_[0] >= 500 && $_[0] < 600; }
105
106139µs1;
107
108
109__END__
 
# spent 80µs within HTTP::Status::CORE:match which was called 166 times, avg 483ns/call: # 166 times (80µs+0s) by LWP::Simple::BEGIN@14 at line 91, avg 483ns/call
sub HTTP::Status::CORE:match; # opcode