Profile of HTTP/Headers/ActionPack/Core/BaseHeaderWithParams.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/Core/BaseHeaderWithParams.pm
Statements | Executed 1500027 statements in 6.61s

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
200002 | 1 | 1 | 1.54s | 1.83s | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::params_in_orderHTTP::Headers::ActionPack::Core::BaseHeaderWithParams::params_in_order
100001 | 1 | 1 | 1.10s | 1.10s | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::_prepare_paramsHTTP::Headers::ActionPack::Core::BaseHeaderWithParams::_prepare_params
100001 | 1 | 1 | 898ms | 994ms | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::params_are_emptyHTTP::Headers::ActionPack::Core::BaseHeaderWithParams::params_are_empty
200002 | 2 | 2 | 376ms | 376ms | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::paramsHTTP::Headers::ActionPack::Core::BaseHeaderWithParams::params
200002 | 1 | 1 | 292ms | 292ms | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::_param_orderHTTP::Headers::ActionPack::Core::BaseHeaderWithParams::_param_order
1 | 1 | 1 | 8µs | 345µs | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::BEGIN@15HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@15
1 | 1 | 1 | 8µs | 12µs | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::BEGIN@11HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@11
1 | 1 | 1 | 7µs | 7µs | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::BEGIN@2HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@2
1 | 1 | 1 | 7µs | 18µs | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::BEGIN@10HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@10
1 | 1 | 1 | 7µs | 32µs | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::BEGIN@13HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@13
0 | 0 | 0 | 0s | 0s | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::add_paramHTTP::Headers::ActionPack::Core::BaseHeaderWithParams::add_param
0 | 0 | 0 | 0s | 0s | HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::::remove_paramHTTP::Headers::ActionPack::Core::BaseHeaderWithParams::remove_param

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::Core::BaseHeaderWithParams;
2 |  |  |  |  | # spent 7µs within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@2 which was called: # once (7µs+0s) by parent::import at line 4 BEGIN {
3 | 1 | 4µs |  |  | $HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::AUTHORITY = 'cpan:STEVAN';
4 | 1 | 30µs | 1 | 7µs | } # spent 7µs making 1 call to HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@2
5 |  |  |  |  | {
6 | 2 | 900ns |  |  | $HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::VERSION = '0.09';
7 |  |  |  |  | }
8 |  |  |  |  | # ABSTRACT: A Base header type with parameters
9 |  |  |  |  |
10 | 2 | 21µs | 2 | 30µs | # spent 18µs (7+11) within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@10 which was called: # once (7µs+11µs) by parent::import at line 10 use strict; # spent 18µs making 1 call to HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@10 # spent 11µs making 1 call to strict::import
11 | 2 | 21µs | 2 | 17µs | # spent 12µs (8+5) within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@11 which was called: # once (8µs+5µs) by parent::import at line 11 use warnings; # spent 12µs making 1 call to HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@11 # spent 5µs making 1 call to warnings::import
12 |  |  |  |  |
13 | 2 | 24µs | 2 | 56µs | # spent 32µs (7+25) within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@13 which was called: # once (7µs+25µs) by parent::import at line 13 use Carp qw[ confess ]; # spent 32µs making 1 call to HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@13 # spent 25µs making 1 call to Exporter::import
14 |  |  |  |  |
15 | 2 | 236µs | 2 | 345µs | # spent 345µs (8+337) within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@15 which was called: # once (8µs+337µs) by parent::import at line 15 use parent 'HTTP::Headers::ActionPack::Core::Base'; # spent 345µs making 1 call to HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::BEGIN@15 # spent 337µs making 1 call to parent::import, recursion: max depth 2, sum of overlapping time 337µs
16 |  |  |  |  |
17 |  |  |  |  | # NOTE:
18 |  |  |  |  | # this is meant to be
19 |  |  |  |  | # called by subclasses
20 |  |  |  |  | # in their BUILDARGS
21 |  |  |  |  | # methods
22 |  |  |  |  | # - SL
23 |  |  |  |  | # spent 1.10s within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::_prepare_params which was called 100001 times, avg 11µs/call: # 100001 times (1.10s+0s) by HTTP::Headers::ActionPack::Core::BaseHeaderType::BUILDARGS at line 30 of HTTP/Headers/ActionPack/Core/BaseHeaderType.pm, avg 11µs/call sub _prepare_params {
24 | 100001 | 76.6ms |  |  | my ($class, @params) = @_;
25 |  |  |  |  |
26 | 100001 | 205ms |  |  | confess "Params must be an even sized list" unless (((scalar @params) % 2) == 0);
27 |  |  |  |  |
28 | 100001 | 31.8ms |  |  | my @param_order;
29 | 100001 | 203ms |  |  | for ( my $i = 0; $i < $#params; $i += 2 ) {
30 |  |  |  |  | push @param_order => $params[ $i ];
31 |  |  |  |  | }
32 |  |  |  |  |
33 |  |  |  |  | return +{
34 | 100001 | 1.10s |  |  | params => { @params },
35 |  |  |  |  | param_order => \@param_order
36 |  |  |  |  | };
37 |  |  |  |  | }
38 |  |  |  |  |
39 | 200002 | 1.28s |  |  | # spent 376ms within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::params which was called 200002 times, avg 2µs/call: # 100001 times (280ms+0s) by HTTP::Headers::ActionPack::MediaTypeList::add_header_value at line 35 of HTTP/Headers/ActionPack/MediaTypeList.pm, avg 3µs/call # 100001 times (95.9ms+0s) by HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::params_are_empty at line 61, avg 959ns/call sub params { (shift)->{'params'} }
40 | 200002 | 1.13s |  |  | # spent 292ms within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::_param_order which was called 200002 times, avg 1µs/call: # 200002 times (292ms+0s) by HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::params_in_order at line 56, avg 1µs/call sub _param_order { (shift)->{'param_order'} }
41 |  |  |  |  |
42 |  |  |  |  | sub add_param {
43 |  |  |  |  | my ($self, $k, $v) = @_;
44 |  |  |  |  | $self->params->{ $k } = $v;
45 |  |  |  |  | push @{ $self->_param_order } => $k;
46 |  |  |  |  | }
47 |  |  |  |  |
48 |  |  |  |  | sub remove_param {
49 |  |  |  |  | my ($self, $k) = @_;
50 |  |  |  |  | $self->{'param_order'} = [ grep { $_ ne $k } @{ $self->{'param_order'} } ];
51 |  |  |  |  | return delete $self->params->{ $k };
52 |  |  |  |  | }
53 |  |  |  |  |
54 |  |  |  |  | # spent 1.83s (1.54+292ms) within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::params_in_order which was called 200002 times, avg 9µs/call: # 200002 times (1.54s+292ms) by HTTP::Headers::ActionPack::Core::BaseHeaderType::as_string at line 43 of HTTP/Headers/ActionPack/Core/BaseHeaderType.pm, avg 9µs/call sub params_in_order {
55 | 200002 | 62.4ms |  |  | my $self = shift;
56 | 200002 | 1.58s | 200002 | 292ms | map { $_, $self->params->{ $_ } } @{ $self->_param_order } # spent 292ms making 200002 calls to HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::_param_order, avg 1µs/call
57 |  |  |  |  | }
58 |  |  |  |  |
59 |  |  |  |  | # spent 994ms (898+95.9) within HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::params_are_empty which was called 100001 times, avg 10µs/call: # 100001 times (898ms+95.9ms) by PONAPI::Server::_ponapi_check_headers at line 226 of lib/PONAPI/Server.pm, avg 10µs/call sub params_are_empty {
60 | 100001 | 56.2ms |  |  | my $self = shift;
61 | 100001 | 878ms | 100001 | 95.9ms | (scalar keys %{ $self->params }) == 0 ? 1 : 0 # spent 95.9ms making 100001 calls to HTTP::Headers::ActionPack::Core::BaseHeaderWithParams::params, avg 959ns/call
62 |  |  |  |  | }
63 |  |  |  |  |
64 | 1 | 2µs |  |  | 1;
65 |  |  |  |  |
66 |  |  |  |  | __END__