← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:12 2016

Filename/usr/local/lib/perl/5.18.2/HTTP/Parser/XS.pm
StatementsExecuted 23 statements in 430µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
100001111.57s1.57sHTTP::Parser::XS::::parse_http_requestHTTP::Parser::XS::parse_http_request (xsub)
11112µs56µsHTTP::Parser::XS::::BEGIN@16HTTP::Parser::XS::BEGIN@16
1118µs16µsHTTP::Parser::XS::::BEGIN@3HTTP::Parser::XS::BEGIN@3
1117µs70µsHTTP::Parser::XS::::BEGIN@6HTTP::Parser::XS::BEGIN@6
1116µs8µsHTTP::Parser::XS::::BEGIN@4HTTP::Parser::XS::BEGIN@4
111200ns200nsHTTP::Parser::XS::::CORE:matchHTTP::Parser::XS::CORE:match (opcode)
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package HTTP::Parser::XS;
2
3218µs225µs
# spent 16µs (8+8) within HTTP::Parser::XS::BEGIN@3 which was called: # once (8µs+8µs) by Plack::HTTPParser::try {...} at line 3
use strict;
# spent 16µs making 1 call to HTTP::Parser::XS::BEGIN@3 # spent 8µs making 1 call to strict::import
4223µs211µs
# spent 8µs (6+3) within HTTP::Parser::XS::BEGIN@4 which was called: # once (6µs+3µs) by Plack::HTTPParser::try {...} at line 4
use warnings;
# spent 8µs making 1 call to HTTP::Parser::XS::BEGIN@4 # spent 3µs making 1 call to warnings::import
5
6276µs2134µs
# spent 70µs (7+64) within HTTP::Parser::XS::BEGIN@6 which was called: # once (7µs+64µs) by Plack::HTTPParser::try {...} at line 6
use base qw(Exporter);
# spent 70µs making 1 call to HTTP::Parser::XS::BEGIN@6 # spent 64µs making 1 call to base::import
7
812µsour %EXPORT_TAGS = (
9 'all' => [ qw/parse_http_request parse_http_response
10 HEADERS_NONE HEADERS_AS_HASHREF HEADERS_AS_ARRAYREF/ ],
11);
1212µsour @EXPORT_OK = @{$EXPORT_TAGS{all}};
131200nsour @EXPORT = ();
14
15# header format for parse_http_response()
16
# spent 56µs (12+45) within HTTP::Parser::XS::BEGIN@16 which was called: # once (12µs+45µs) by Plack::HTTPParser::try {...} at line 20
use constant {
1719µs145µs HEADERS_NONE => 0, # don't parse headers. It's fastest. if you want only special headers, also fastest.
# spent 45µs making 1 call to constant::import
18 HEADERS_AS_HASHREF => 1, # HTTP::Headers compatible HashRef, { header_name => "header_value" or ["val1", "val2"] }
19 HEADERS_AS_ARRAYREF =>2, # Ordered ArrayRef : [ name, value, name2, value2 ... ]
201126µs156µs};
# spent 56µs making 1 call to HTTP::Parser::XS::BEGIN@16
21
221300nsour $VERSION = '0.16';
23
241100nsour $BACKEND;
25
2619µs12µsif (not __PACKAGE__->can('parse_http_response')) {
# spent 2µs making 1 call to UNIVERSAL::can
271800ns $BACKEND = $ENV{PERL_HTTP_PARSER_XS} || ($ENV{PERL_ONLY} ? 'pp' : '');
2814µs1200ns if ($BACKEND !~ /\b pp \b/xms) {
# spent 200ns making 1 call to HTTP::Parser::XS::CORE:match
291300ns eval {
301700ns require XSLoader;
311144µs1139µs XSLoader::load(__PACKAGE__, $VERSION);
# spent 139µs making 1 call to XSLoader::load
321600ns $BACKEND = 'xs';
33 };
341200ns die $@ if $@ && $BACKEND =~ /\bxs\b/;
35 }
3615µs11µs if (not __PACKAGE__->can('parse_http_response')) {
# spent 1µs making 1 call to UNIVERSAL::can
37 require HTTP::Parser::XS::PP;
38 $BACKEND = 'pp';
39 }
40}
41
42110µs1;
43__END__
 
# spent 200ns within HTTP::Parser::XS::CORE:match which was called: # once (200ns+0s) by Plack::HTTPParser::try {...} at line 28
sub HTTP::Parser::XS::CORE:match; # opcode
# spent 1.57s within HTTP::Parser::XS::parse_http_request which was called 100001 times, avg 16µs/call: # 100001 times (1.57s+0s) by HTTP::Server::PSGI::handle_connection at line 147 of HTTP/Server/PSGI.pm, avg 16µs/call
sub HTTP::Parser::XS::parse_http_request; # xsub