← 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:10 2016

Filename/usr/local/share/perl/5.18.2/Plack/Component.pm
StatementsExecuted 800072 statements in 6.28s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
600006664.97s5431sPlack::Component::::__ANON__[:50]Plack::Component::__ANON__[:50]
10000111732ms12.5sPlack::Component::::response_cbPlack::Component::response_cb
62277µs811msPlack::Component::::to_appPlack::Component::to_app
63351µs51µsPlack::Component::::newPlack::Component::new
1118µs18µsPlack::Component::::BEGIN@2Plack::Component::BEGIN@2
1118µs35µsPlack::Component::::BEGIN@6Plack::Component::BEGIN@6
1117µs11µsPlack::Component::::BEGIN@3Plack::Component::BEGIN@3
1115µs5µsPlack::Component::::BEGIN@5Plack::Component::BEGIN@5
4115µs5µsPlack::Component::::prepare_appPlack::Component::prepare_app
1113µs3µsPlack::Component::::BEGIN@4Plack::Component::BEGIN@4
0000s0sPlack::Component::::mk_accessorsPlack::Component::mk_accessors
0000s0sPlack::Component::::to_app_autoPlack::Component::to_app_auto
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Plack::Component;
2224µs227µs
# spent 18µs (8+9) within Plack::Component::BEGIN@2 which was called: # once (8µs+9µs) by parent::import at line 2
use strict;
# spent 18µs making 1 call to Plack::Component::BEGIN@2 # spent 9µs making 1 call to strict::import
3217µs215µs
# spent 11µs (7+4) within Plack::Component::BEGIN@3 which was called: # once (7µs+4µs) by parent::import at line 3
use warnings;
# spent 11µs making 1 call to Plack::Component::BEGIN@3 # spent 4µs making 1 call to warnings::import
4215µs13µs
# spent 3µs within Plack::Component::BEGIN@4 which was called: # once (3µs+0s) by parent::import at line 4
use Carp ();
# spent 3µs making 1 call to Plack::Component::BEGIN@4
5231µs15µs
# spent 5µs within Plack::Component::BEGIN@5 which was called: # once (5µs+0s) by parent::import at line 5
use Plack::Util;
# spent 5µs making 1 call to Plack::Component::BEGIN@5
62221µs262µs
# spent 35µs (8+27) within Plack::Component::BEGIN@6 which was called: # once (8µs+27µs) by parent::import at line 6
use overload '&{}' => \&to_app_auto, fallback => 1;
# spent 35µs making 1 call to Plack::Component::BEGIN@6 # spent 27µs making 1 call to overload::import
7
8
# spent 51µs within Plack::Component::new which was called 6 times, avg 9µs/call: # 4 times (26µs+0s) by Plack::Middleware::wrap at line 14 of Plack/Middleware.pm, avg 6µs/call # once (19µs+0s) by Plack::Middleware::MethodOverride::new at line 17 of Plack/Middleware/MethodOverride.pm # once (7µs+0s) by PONAPI::CLI::RunServer::run at line 19 of lib/PONAPI/CLI/RunServer.pm
sub new {
967µs my $proto = shift;
1063µs my $class = ref $proto || $proto;
11
1263µs my $self;
13625µs if (@_ == 1 && ref $_[0] eq 'HASH') {
14 $self = bless {%{$_[0]}}, $class;
15 } else {
1612µs $self = bless {@_}, $class;
17 }
18
19624µs $self;
20}
21
22sub to_app_auto {
23 my $self = shift;
24 if (($ENV{PLACK_ENV} || '') eq 'development') {
25 my $class = ref($self);
26 warn "WARNING: Automatically converting $class instance to a PSGI code reference. " .
27 "If you see this warning for each request, you probably need to explicitly call " .
28 "to_app() i.e. $class->new(...)->to_app in your PSGI file.\n";
29 }
30 $self->to_app(@_);
31}
32
33# NOTE:
34# this is for back-compat only,
35# future modules should use
36# Plack::Util::Accessor directly
37# or their own favorite accessor
38# generator.
39# - SL
40sub mk_accessors {
41 my $self = shift;
42 Plack::Util::Accessor::mk_accessors( ref( $self ) || $self, @_ )
43}
44
45414µs
# spent 5µs within Plack::Component::prepare_app which was called 4 times, avg 1µs/call: # 4 times (5µs+0s) by Plack::Component::to_app at line 49, avg 1µs/call
sub prepare_app { return }
46
47
# spent 811ms (77µs+811) within Plack::Component::to_app which was called 6 times, avg 135ms/call: # 5 times (61µs+411µs) by Plack::Middleware::wrap at line 16 of Plack/Middleware.pm, avg 94µs/call # once (16µs+811ms) by PONAPI::CLI::RunServer::run at line 19 of lib/PONAPI/CLI/RunServer.pm
sub to_app {
4862µs my $self = shift;
49620µs6811ms $self->prepare_app;
# spent 811ms making 1 call to PONAPI::Server::prepare_app # spent 407µs making 1 call to Plack::Middleware::AccessLog::prepare_app # spent 5µs making 4 calls to Plack::Component::prepare_app, avg 1µs/call
506000125.70s6000065426s
# spent 5431s (4.97+5426) within Plack::Component::__ANON__[/usr/local/share/perl/5.18.2/Plack/Component.pm:50] which was called 600006 times, avg 9.05ms/call: # 100001 times (951ms+947s) by Plack::Util::run_app at line 145 of Plack/Util.pm, avg 9.48ms/call # 100001 times (807ms+931s) by Plack::Middleware::ContentLength::call at line 10 of Plack/Middleware/ContentLength.pm, avg 9.31ms/call # 100001 times (771ms+908s) by Plack::Middleware::AccessLog::call at line 24 of Plack/Middleware/AccessLog.pm, avg 9.09ms/call # 100001 times (688ms+894s) by Plack::Middleware::StackTrace::try {...} at line 38 of Plack/Middleware/StackTrace.pm, avg 8.94ms/call # 100001 times (846ms+875s) by Plack::Middleware::Lint::call at line 24 of Plack/Middleware/Lint.pm, avg 8.76ms/call # 100001 times (902ms+871s) by Plack::Middleware::MethodOverride::call at line 37 of Plack/Middleware/MethodOverride.pm, avg 8.72ms/call
return sub { $self->call(@_) };
# spent 947s making 100001 calls to Plack::Middleware::ContentLength::call, avg 9.47ms/call # spent 931s making 100001 calls to Plack::Middleware::AccessLog::call, avg 9.31ms/call # spent 908s making 100001 calls to Plack::Middleware::StackTrace::call, avg 9.08ms/call # spent 894s making 100001 calls to Plack::Middleware::Lint::call, avg 8.94ms/call # spent 875s making 100001 calls to Plack::Middleware::MethodOverride::call, avg 8.75ms/call # spent 871s making 100001 calls to PONAPI::Server::call, avg 8.71ms/call
51}
52
53
54
# spent 12.5s (732ms+11.8) within Plack::Component::response_cb which was called 100001 times, avg 125µs/call: # 100001 times (732ms+11.8s) by Plack::Middleware::ContentLength::call at line 21 of Plack/Middleware/ContentLength.pm, avg 125µs/call
sub response_cb {
5510000178.8ms my($self, $res, $cb) = @_;
56100001497ms10000111.8s Plack::Util::response_cb($res, $cb);
# spent 11.8s making 100001 calls to Plack::Util::response_cb, avg 118µs/call
57}
58
5912µs1;
60
61__END__