← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:07 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Role/Transport.pm
StatementsExecuted 17027 statements in 33.3ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
10011125.3ms82.1msSearch::Elasticsearch::Role::Transport::::tidy_requestSearch::Elasticsearch::Role::Transport::tidy_request
10011116.1ms89.9msSearch::Elasticsearch::Role::Transport::::BUILDSearch::Elasticsearch::Role::Transport::BUILD
11120µs337µsSearch::Elasticsearch::Role::Transport::::BEGIN@9Search::Elasticsearch::Role::Transport::BEGIN@9
11112µs780µsSearch::Elasticsearch::Role::Transport::::BEGIN@3Search::Elasticsearch::Role::Transport::BEGIN@3
11110µs323µsSearch::Elasticsearch::Role::Transport::::BEGIN@8Search::Elasticsearch::Role::Transport::BEGIN@8
1119µs47µsSearch::Elasticsearch::Role::Transport::::BEGIN@7Search::Elasticsearch::Role::Transport::BEGIN@7
2221µs1µsSearch::Elasticsearch::Role::Transport::::cxn_poolSearch::Elasticsearch::Role::Transport::cxn_pool (xsub)
2211µs1µsSearch::Elasticsearch::Role::Transport::::serializerSearch::Elasticsearch::Role::Transport::serializer (xsub)
111700ns700nsSearch::Elasticsearch::Role::Transport::::loggerSearch::Elasticsearch::Role::Transport::logger (xsub)
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Search::Elasticsearch::Role::Transport;
211µs$Search::Elasticsearch::Role::Transport::VERSION = '5.01';
3235µs21.55ms
# spent 780µs (12+768) within Search::Elasticsearch::Role::Transport::BEGIN@3 which was called: # once (12µs+768µs) by Module::Runtime::require_module at line 3
use Moo::Role;
# spent 780µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@3 # spent 768µs making 1 call to Moo::Role::import
4
514µs148µsrequires qw(perform_request);
# spent 48µs making 1 call to Moo::Role::requires
6
7222µs284µs
# spent 47µs (9+38) within Search::Elasticsearch::Role::Transport::BEGIN@7 which was called: # once (9µs+38µs) by Module::Runtime::require_module at line 7
use Try::Tiny;
# spent 47µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@7 # spent 38µs making 1 call to Exporter::import
8244µs2637µs
# spent 323µs (10+314) within Search::Elasticsearch::Role::Transport::BEGIN@8 which was called: # once (10µs+314µs) by Module::Runtime::require_module at line 8
use Search::Elasticsearch::Util qw(parse_params is_compat);
# spent 323µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@8 # spent 314µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
92446µs2655µs
# spent 337µs (20+318) within Search::Elasticsearch::Role::Transport::BEGIN@9 which was called: # once (20µs+318µs) by Module::Runtime::require_module at line 9
use namespace::clean;
# spent 337µs making 1 call to Search::Elasticsearch::Role::Transport::BEGIN@9 # spent 318µs making 1 call to namespace::clean::import
10
1112µs1500µshas 'serializer' => ( is => 'ro', required => 1 );
# spent 500µs making 1 call to Moo::Role::has
1212µs1149µshas 'logger' => ( is => 'ro', required => 1 );
# spent 149µs making 1 call to Moo::Role::has
1312µs187µshas 'send_get_body_as' => ( is => 'ro', default => 'GET' );
# spent 87µs making 1 call to Moo::Role::has
141600ns150µshas 'cxn_pool' => ( is => 'ro', required => 1 );
# spent 50µs making 1 call to Moo::Role::has
15
16#===================================
17
# spent 89.9ms (16.1+73.9) within Search::Elasticsearch::Role::Transport::BUILD which was called 1001 times, avg 90µs/call: # 1001 times (16.1ms+73.9ms) by Search::Elasticsearch::Transport::new at line 66 of (eval 292)[Sub/Quote.pm:3], avg 90µs/call
sub BUILD {
18#===================================
191001370µs my $self = shift;
2010011.21ms1500ns my $pool = $self->cxn_pool;
# spent 500ns making 1 call to Search::Elasticsearch::Role::Transport::cxn_pool
2110012.16ms100142.9ms is_compat( 'cxn_pool', $self, $pool );
# spent 42.9ms making 1001 calls to Search::Elasticsearch::Util::is_compat, avg 43µs/call
2210012.75ms100331.0ms is_compat( 'cxn', $self, $pool->cxn_factory->cxn_class );
# spent 31.0ms making 1001 calls to Search::Elasticsearch::Util::is_compat, avg 31µs/call # spent 800ns making 1 call to Search::Elasticsearch::Role::CxnPool::cxn_factory # spent 500ns making 1 call to Search::Elasticsearch::Cxn::Factory::cxn_class
2310018.02ms return $self;
24}
25
26#===================================
27
# spent 82.1ms (25.3+56.8) within Search::Elasticsearch::Role::Transport::tidy_request which was called 1001 times, avg 82µs/call: # 1001 times (25.3ms+56.8ms) by Search::Elasticsearch::Transport::perform_request at line 18 of Search/Elasticsearch/Transport.pm, avg 82µs/call
sub tidy_request {
28#===================================
2910012.22ms10016.14ms my ( $self, $params ) = parse_params(@_);
# spent 6.14ms making 1001 calls to Search::Elasticsearch::Util::parse_params, avg 6µs/call
301001662µs $params->{method} ||= 'GET';
311001514µs $params->{path} ||= '/';
321001449µs $params->{qs} ||= {};
331001468µs $params->{ignore} ||= [];
341001512µs my $body = $params->{body};
351001237µs return $params unless defined $body;
36
371000346µs $params->{serialize} ||= 'std';
38 $params->{data}
3910007.23ms100150.6ms = $params->{serialize} eq 'std'
# spent 50.6ms making 1000 calls to Search::Elasticsearch::Role::Serializer::JSON::encode, avg 51µs/call # spent 600ns making 1 call to Search::Elasticsearch::Role::Transport::serializer
40 ? $self->serializer->encode($body)
41 : $self->serializer->encode_bulk($body);
42
431000676µs if ( $params->{method} eq 'GET' ) {
44 my $send_as = $self->send_get_body_as;
45 if ( $send_as eq 'POST' ) {
46 $params->{method} = 'POST';
47 }
48 elsif ( $send_as eq 'source' ) {
49 $params->{qs}{source} = delete $params->{data};
50 delete $params->{body};
51 }
52 }
53
5410002.59ms21µs $params->{mime_type} ||= $self->serializer->mime_type;
5510002.30ms return $params;
56
57}
58
5916µs1;
60
61#ABSTRACT: Transport role providing interface between the client class and the Elasticsearch cluster
62
63117µs1414µs__END__
 
# spent 1µs within Search::Elasticsearch::Role::Transport::cxn_pool which was called 2 times, avg 500ns/call: # once (500ns+0s) by Search::Elasticsearch::Transport::perform_request at line 19 of Search/Elasticsearch/Transport.pm # once (500ns+0s) by Search::Elasticsearch::Role::Transport::BUILD at line 20
sub Search::Elasticsearch::Role::Transport::cxn_pool; # xsub
# spent 700ns within Search::Elasticsearch::Role::Transport::logger which was called: # once (700ns+0s) by Search::Elasticsearch::Transport::perform_request at line 20 of Search/Elasticsearch/Transport.pm
sub Search::Elasticsearch::Role::Transport::logger; # xsub
# spent 1µs within Search::Elasticsearch::Role::Transport::serializer which was called 2 times, avg 500ns/call: # once (600ns+0s) by Search::Elasticsearch::Role::Transport::tidy_request at line 39 # once (400ns+0s) by Search::Elasticsearch::Role::Transport::tidy_request at line 54
sub Search::Elasticsearch::Role::Transport::serializer; # xsub