Profile of HTTP/Headers/ActionPack/Util.pm

← 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/share/perl/5.18.2/HTTP/Headers/ActionPack/Util.pm
Statements | Executed 1000026 statements in 2.46s

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
100001 | 1 | 1 | 1.24s | 4.38s | HTTP::Headers::ActionPack::Util::::split_header_wordsHTTP::Headers::ActionPack::Util::split_header_words
200002 | 1 | 1 | 561ms | 561ms | HTTP::Headers::ActionPack::Util::::join_header_wordsHTTP::Headers::ActionPack::Util::join_header_words
1 | 1 | 1 | 6.29ms | 11.9ms | HTTP::Headers::ActionPack::Util::::BEGIN@13HTTP::Headers::ActionPack::Util::BEGIN@13
1 | 1 | 1 | 751µs | 918µs | HTTP::Headers::ActionPack::Util::::BEGIN@15HTTP::Headers::ActionPack::Util::BEGIN@15
1 | 1 | 1 | 20µs | 41µs | HTTP::Headers::ActionPack::Util::::BEGIN@11HTTP::Headers::ActionPack::Util::BEGIN@11
1 | 1 | 1 | 19µs | 19µs | HTTP::Headers::ActionPack::Util::::BEGIN@2HTTP::Headers::ActionPack::Util::BEGIN@2
1 | 1 | 1 | 16µs | 392µs | HTTP::Headers::ActionPack::Util::::BEGIN@17HTTP::Headers::ActionPack::Util::BEGIN@17
1 | 1 | 1 | 15µs | 67µs | HTTP::Headers::ActionPack::Util::::BEGIN@10HTTP::Headers::ActionPack::Util::BEGIN@10
1 | 1 | 1 | 12µs | 75µs | HTTP::Headers::ActionPack::Util::::BEGIN@14HTTP::Headers::ActionPack::Util::BEGIN@14
0 | 0 | 0 | 0s | 0s | HTTP::Headers::ActionPack::Util::::date_to_headerHTTP::Headers::ActionPack::Util::date_to_header
0 | 0 | 0 | 0s | 0s | HTTP::Headers::ActionPack::Util::::header_to_dateHTTP::Headers::ActionPack::Util::header_to_date
0 | 0 | 0 | 0s | 0s | HTTP::Headers::ActionPack::Util::::join_header_paramsHTTP::Headers::ActionPack::Util::join_header_params

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package HTTP::Headers::ActionPack::Util;
2 |  |  |  |  | # spent 19µs within HTTP::Headers::ActionPack::Util::BEGIN@2 which was called: # once (19µs+0s) by HTTP::Headers::ActionPack::Core::BaseHeaderType::BEGIN@15 at line 4 BEGIN {
3 | 1 | 20µs |  |  | $HTTP::Headers::ActionPack::Util::AUTHORITY = 'cpan:STEVAN';
4 | 1 | 68µs | 1 | 19µs | } # spent 19µs making 1 call to HTTP::Headers::ActionPack::Util::BEGIN@2
5 |  |  |  |  | {
6 | 2 | 1µs |  |  | $HTTP::Headers::ActionPack::Util::VERSION = '0.09';
7 |  |  |  |  | }
8 |  |  |  |  | # ABSTRACT: General Utility module
9 |  |  |  |  |
10 | 2 | 41µs | 2 | 120µs | # spent 67µs (15+52) within HTTP::Headers::ActionPack::Util::BEGIN@10 which was called: # once (15µs+52µs) by HTTP::Headers::ActionPack::Core::BaseHeaderType::BEGIN@15 at line 10 use strict; # spent 67µs making 1 call to HTTP::Headers::ActionPack::Util::BEGIN@10 # spent 52µs making 1 call to strict::import
11 | 2 | 43µs | 2 | 63µs | # spent 41µs (20+22) within HTTP::Headers::ActionPack::Util::BEGIN@11 which was called: # once (20µs+22µs) by HTTP::Headers::ActionPack::Core::BaseHeaderType::BEGIN@15 at line 11 use warnings; # spent 41µs making 1 call to HTTP::Headers::ActionPack::Util::BEGIN@11 # spent 22µs making 1 call to warnings::import
12 |  |  |  |  |
13 | 2 | 349µs | 2 | 11.9ms | # spent 11.9ms (6.29+5.58) within HTTP::Headers::ActionPack::Util::BEGIN@13 which was called: # once (6.29ms+5.58ms) by HTTP::Headers::ActionPack::Core::BaseHeaderType::BEGIN@15 at line 13 use Time::Piece; # spent 11.9ms making 1 call to HTTP::Headers::ActionPack::Util::BEGIN@13 # spent 48µs making 1 call to Time::Piece::import
14 | 2 | 33µs | 2 | 138µs | # spent 75µs (12+63) within HTTP::Headers::ActionPack::Util::BEGIN@14 which was called: # once (12µs+63µs) by HTTP::Headers::ActionPack::Core::BaseHeaderType::BEGIN@15 at line 14 use HTTP::Date qw[ str2time time2str ]; # spent 75µs making 1 call to HTTP::Headers::ActionPack::Util::BEGIN@14 # spent 63µs making 1 call to Exporter::import
15 | 2 | 148µs | 2 | 938µs | # spent 918µs (751+168) within HTTP::Headers::ActionPack::Util::BEGIN@15 which was called: # once (751µs+168µs) by HTTP::Headers::ActionPack::Core::BaseHeaderType::BEGIN@15 at line 15 use HTTP::Headers::Util; # spent 918µs making 1 call to HTTP::Headers::ActionPack::Util::BEGIN@15 # spent 20µs making 1 call to Exporter::import
16 |  |  |  |  |
17 | 1 | 11µs | 1 | 376µs | # spent 392µs (16+376) within HTTP::Headers::ActionPack::Util::BEGIN@17 which was called: # once (16µs+376µs) by HTTP::Headers::ActionPack::Core::BaseHeaderType::BEGIN@15 at line 25 use Sub::Exporter -setup => { # spent 376µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
18 |  |  |  |  | exports => [qw[
19 |  |  |  |  | header_to_date
20 |  |  |  |  | date_to_header
21 |  |  |  |  | split_header_words
22 |  |  |  |  | join_header_words
23 |  |  |  |  | join_header_params
24 |  |  |  |  | ]]
25 | 1 | 273µs | 1 | 392µs | }; # spent 392µs making 1 call to HTTP::Headers::ActionPack::Util::BEGIN@17
26 |  |  |  |  |
27 |  |  |  |  | sub header_to_date { scalar Time::Piece->gmtime( str2time( shift ) ) }
28 |  |  |  |  | sub date_to_header { time2str( shift->epoch ) }
29 |  |  |  |  |
30 |  |  |  |  | # spent 4.38s (1.24+3.14) within HTTP::Headers::ActionPack::Util::split_header_words which was called 100001 times, avg 44µs/call: # 100001 times (1.24s+3.14s) by HTTP::Headers::ActionPack::PriorityList::new_from_string at line 35 of HTTP/Headers/ActionPack/PriorityList.pm, avg 44µs/call sub split_header_words {
31 | 100001 | 55.7ms |  |  | my $header = shift;
32 | 100001 | 178ms |  |  | map {
33 | 100001 | 969ms | 100001 | 3.14s | splice @$_, 1, 1; # spent 3.14s making 100001 calls to HTTP::Headers::Util::_split_header_words, avg 31µs/call
34 | 100001 | 48.2ms |  |  | $_;
35 |  |  |  |  | } HTTP::Headers::Util::_split_header_words( $header );
36 |  |  |  |  | }
37 |  |  |  |  |
38 |  |  |  |  | # spent 561ms within HTTP::Headers::ActionPack::Util::join_header_words which was called 200002 times, avg 3µs/call: # 200002 times (561ms+0s) by HTTP::Headers::ActionPack::Core::BaseHeaderType::as_string at line 43 of HTTP/Headers/ActionPack/Core/BaseHeaderType.pm, avg 3µs/call sub join_header_words {
39 | 200002 | 127ms |  |  | my ($subject, @params) = @_;
40 | 200002 | 82.6ms |  |  | return $subject . '; ' . join_header_params( '; ' => @params ) if @params;
41 | 200002 | 1.00s |  |  | return $subject;
42 |  |  |  |  | }
43 |  |  |  |  |
44 |  |  |  |  | sub join_header_params {
45 |  |  |  |  | my ($separator, @params) = @_;
46 |  |  |  |  | my @attrs;
47 |  |  |  |  | while ( @params ) {
48 |  |  |  |  | my $k = shift @params;
49 |  |  |  |  | my $v = shift @params;
50 |  |  |  |  |
51 |  |  |  |  | if (defined $v) {
52 |  |  |  |  | $v =~ s/([\"\\])/\\$1/g; # escape " and \
53 |  |  |  |  | }
54 |  |  |  |  | else {
55 |  |  |  |  | $v = q{};
56 |  |  |  |  | }
57 |  |  |  |  | push @attrs => ($k . qq(="$v"));
58 |  |  |  |  | }
59 |  |  |  |  | return join $separator => @attrs;
60 |  |  |  |  | }
61 |  |  |  |  |
62 | 1 | 3µs |  |  | 1;
63 |  |  |  |  |
64 |  |  |  |  | __END__