← 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/BenchmarkAnything/Storage/Backend/SQL/Query.pm
StatementsExecuted 225492 statements in 28.5s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
27629152863ms5.62sBenchmarkAnything::Storage::Backend::SQL::Query::::execute_queryBenchmarkAnything::Storage::Backend::SQL::Query::execute_query
200021127ms22.8sBenchmarkAnything::Storage::Backend::SQL::Query::::finish_transactionBenchmarkAnything::Storage::Backend::SQL::Query::finish_transaction
20002173.5ms212msBenchmarkAnything::Storage::Backend::SQL::Query::::start_transactionBenchmarkAnything::Storage::Backend::SQL::Query::start_transaction
1028215.89ms7.91msBenchmarkAnything::Storage::Backend::SQL::Query::::last_insert_idBenchmarkAnything::Storage::Backend::SQL::Query::last_insert_id
1118µs9µsBenchmarkAnything::Storage::Backend::SQL::Query::::BEGIN@5BenchmarkAnything::Storage::Backend::SQL::Query::BEGIN@5
1116µs19µsBenchmarkAnything::Storage::Backend::SQL::Query::::BEGIN@7BenchmarkAnything::Storage::Backend::SQL::Query::BEGIN@7
1116µs6µsBenchmarkAnything::Storage::Backend::SQL::Query::::newBenchmarkAnything::Storage::Backend::SQL::Query::new
1114µs6µsBenchmarkAnything::Storage::Backend::SQL::Query::::BEGIN@6BenchmarkAnything::Storage::Backend::SQL::Query::BEGIN@6
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package BenchmarkAnything::Storage::Backend::SQL::Query;
21300nsour $AUTHORITY = 'cpan:TAPPER';
3# ABSTRACT: BenchmarkAnything::Storage::Backend::SQL - querying - base class
41100ns$BenchmarkAnything::Storage::Backend::SQL::Query::VERSION = '0.023';
5213µs210µs
# spent 9µs (8+1) within BenchmarkAnything::Storage::Backend::SQL::Query::BEGIN@5 which was called: # once (8µs+1µs) by base::import at line 5
use strict;
# spent 9µs making 1 call to BenchmarkAnything::Storage::Backend::SQL::Query::BEGIN@5 # spent 1µs making 1 call to strict::import
6212µs28µs
# spent 6µs (4+2) within BenchmarkAnything::Storage::Backend::SQL::Query::BEGIN@6 which was called: # once (4µs+2µs) by base::import at line 6
use warnings;
# spent 6µs making 1 call to BenchmarkAnything::Storage::Backend::SQL::Query::BEGIN@6 # spent 2µs making 1 call to warnings::import
72261µs231µs
# spent 19µs (6+12) within BenchmarkAnything::Storage::Backend::SQL::Query::BEGIN@7 which was called: # once (6µs+12µs) by base::import at line 7
use Digest::MD5;
# spent 19µs making 1 call to BenchmarkAnything::Storage::Backend::SQL::Query::BEGIN@7 # spent 12µs making 1 call to Exporter::import
8
9
# spent 6µs within BenchmarkAnything::Storage::Backend::SQL::Query::new which was called: # once (6µs+0s) by BenchmarkAnything::Storage::Backend::SQL::new at line 162 of BenchmarkAnything/Storage/Backend/SQL.pm
sub new {
10
111400ns my ( $s_self, $hr_atts ) = @_;
12
131500ns my $or_self = bless {}, $s_self;
14
151600ns for my $s_key (qw/ config dbh /) {
162900ns if (! $hr_atts->{$s_key} ) {
17 require Carp;
18 Carp::confess("missing parameter '$s_key'");
19 }
20 }
21
2213µs $or_self->{dbh} = $hr_atts->{dbh};
231300ns $or_self->{debug} = $hr_atts->{debug} || 0;
241100ns $or_self->{config} = $hr_atts->{config};
25
2612µs return $or_self;
27
28}
29
30
# spent 5.62s (863ms+4.75) within BenchmarkAnything::Storage::Backend::SQL::Query::execute_query which was called 27629 times, avg 203µs/call: # 4650 times (131ms+731ms) by BenchmarkAnything::Storage::Backend::SQL::Query::mysql::insert_addvaluerelation at line 425 of BenchmarkAnything/Storage/Backend/SQL/Query/mysql.pm, avg 185µs/call # 4650 times (147ms+495ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::select_addtyperelation at line 515 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 138µs/call # 4650 times (165ms+453ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::select_addtype at line 491 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 133µs/call # 4650 times (107ms+494ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::select_addvalue at line 503 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 129µs/call # 1000 times (43.4ms+622ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::update_raw_bench_bundle_set_processed at line 616 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 665µs/call # 1000 times (44.7ms+483ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::select_complete_benchmark_point at line 176 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 527µs/call # 1000 times (41.7ms+341ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::select_raw_bench_bundle_for_lock at line 689 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 383µs/call # 1000 times (34.2ms+295ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::start_processing_raw_bench_bundle at line 604 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 329µs/call # 1000 times (29.7ms+193ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::select_raw_bench_bundle_for_processing at line 704 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 222µs/call # 1000 times (20.2ms+200ms) by BenchmarkAnything::Storage::Backend::SQL::Query::mysql::insert_benchmark_value at line 382 of BenchmarkAnything/Storage/Backend/SQL/Query/mysql.pm, avg 220µs/call # 1000 times (37.1ms+172ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::select_benchmark_point_essentials at line 117 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 209µs/call # 1000 times (29.4ms+137ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::select_benchmark at line 405 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 167µs/call # 1000 times (32.1ms+112ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::select_min_subsume_type at line 268 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm, avg 144µs/call # 28 times (501µs+3.86ms) by BenchmarkAnything::Storage::Backend::SQL::Query::mysql::insert_addvalue at line 410 of BenchmarkAnything/Storage/Backend/SQL/Query/mysql.pm, avg 156µs/call # once (49µs+23.5ms) by BenchmarkAnything::Storage::Backend::SQL::Query::common::delete_processed_raw_bench_bundles at line 652 of BenchmarkAnything/Storage/Backend/SQL/Query/common.pm
sub execute_query {
31
322762913.1ms my ( $or_self, $s_statement, @a_vals ) = @_;
33
34276297.85ms if ( $or_self->{debug} ) {
35 warn $s_statement . ' (' . (join ',', @a_vals) . ')';
36 }
37
3827629445ms110516399ms local $or_self->{dbh}{RaiseError} = 1;
# spent 241ms making 27629 calls to DBI::common::EXISTS, avg 9µs/call # spent 120ms making 27629 calls to DBD::_::common::EXISTS, avg 4µs/call # spent 25.1ms making 27629 calls to DBI::common::STORE, avg 909ns/call # spent 13.3ms making 27629 calls to DBI::common::FETCH, avg 483ns/call
39
4027629122ms2762942.9ms my $s_key = Digest::MD5::md5($s_statement);
# spent 42.9ms making 27629 calls to Digest::MD5::md5, avg 2µs/call
4127629130ms2761445.3ms if ( $or_self->{prepared}{$s_key} ) {
# spent 45.3ms making 27614 calls to DBI::st::finish, avg 2µs/call
42 $or_self->{prepared}{$s_key}->finish();
43 }
44 else {
451577µs30965µs $or_self->{prepared}{$s_key} = $or_self->{dbh}->prepare( $s_statement );
# spent 509µs making 15 calls to DBI::db::prepare, avg 34µs/call # spent 456µs making 15 calls to DBD::mysql::db::prepare, avg 30µs/call
46 }
47
48276294.47s276294.33s $or_self->{prepared}{$s_key}->execute( @a_vals );
# spent 4.33s making 27629 calls to DBI::st::execute, avg 157µs/call
49
5027629382ms return $or_self->{prepared}{$s_key};
51
52}
53
54
# spent 7.91ms (5.89+2.02) within BenchmarkAnything::Storage::Backend::SQL::Query::last_insert_id which was called 1028 times, avg 8µs/call: # 1000 times (5.77ms+1.98ms) by BenchmarkAnything::Storage::Backend::SQL::add_single_benchmark at line 259 of BenchmarkAnything/Storage/Backend/SQL.pm, avg 8µs/call # 28 times (122µs+36µs) by BenchmarkAnything::Storage::Backend::SQL::add_single_benchmark at line 338 of BenchmarkAnything/Storage/Backend/SQL.pm, avg 6µs/call
sub last_insert_id {
55
561028918µs my ( $or_self, $s_table, $s_column ) = @_;
57
58 return $or_self->{dbh}->last_insert_id(
5910287.22ms10282.02ms undef, undef, $s_table, $s_column,
# spent 2.02ms making 1028 calls to DBI::db::last_insert_id, avg 2µs/call
60 );
61
62}
63
64
# spent 212ms (73.5+138) within BenchmarkAnything::Storage::Backend::SQL::Query::start_transaction which was called 2000 times, avg 106µs/call: # 1000 times (36.1ms+71.7ms) by BenchmarkAnything::Storage::Backend::SQL::process_queued_multi_benchmark at line 415 of BenchmarkAnything/Storage/Backend/SQL.pm, avg 108µs/call # 1000 times (37.4ms+66.4ms) by BenchmarkAnything::Storage::Backend::SQL::process_queued_multi_benchmark at line 431 of BenchmarkAnything/Storage/Backend/SQL.pm, avg 104µs/call
sub start_transaction {
65
6620002.06ms my ( $or_self ) = @_;
67
68200034.7ms800053.4ms local $or_self->{dbh}{RaiseError} = 1;
# spent 28.9ms making 2000 calls to DBI::common::EXISTS, avg 14µs/call # spent 20.9ms making 2000 calls to DBD::_::common::EXISTS, avg 10µs/call # spent 2.34ms making 2000 calls to DBI::common::STORE, avg 1µs/call # spent 1.23ms making 2000 calls to DBI::common::FETCH, avg 613ns/call
69
7020003.21ms eval {
7120007.69ms20001.26ms $or_self->{old_AutoCommit} = $or_self->{dbh}{AutoCommit};
# spent 1.26ms making 2000 calls to DBI::common::FETCH, avg 632ns/call
722000122ms2000100ms $or_self->{dbh}{AutoCommit} = 0;
# spent 100ms making 2000 calls to DBI::common::STORE, avg 50µs/call
73 };
7420001.68ms if ( $@ ) {
75 if ( $or_self->{debug} ) {
76 require Carp;
77 Carp::cluck('Transactions not supported by your database');
78 }
79 }
80 else {
8120001.86ms $or_self->{transaction_supported} = 1;
82 }
83
84200016.9ms return 1;
85
86}
87
88
# spent 22.8s (127ms+22.6) within BenchmarkAnything::Storage::Backend::SQL::Query::finish_transaction which was called 2000 times, avg 11.4ms/call: # 1000 times (56.0ms+11.7s) by BenchmarkAnything::Storage::Backend::SQL::process_queued_multi_benchmark at line 427 of BenchmarkAnything/Storage/Backend/SQL.pm, avg 11.8ms/call # 1000 times (71.3ms+10.9s) by BenchmarkAnything::Storage::Backend::SQL::process_queued_multi_benchmark at line 443 of BenchmarkAnything/Storage/Backend/SQL.pm, avg 11.0ms/call
sub finish_transaction {
89
9020001.84ms my ( $or_self, $s_error ) = @_;
91
9220003.46ms20006.57ms if ( $or_self->{transaction_supported} ) {
# spent 6.57ms making 2000 calls to DBI::common::STORE, avg 3µs/call
93
94200034.2ms800036.4ms local $or_self->{dbh}{RaiseError} = 1;
# spent 19.2ms making 2000 calls to DBI::common::EXISTS, avg 10µs/call # spent 14.6ms making 2000 calls to DBD::_::common::EXISTS, avg 7µs/call # spent 1.51ms making 2000 calls to DBI::common::STORE, avg 756ns/call # spent 1.02ms making 2000 calls to DBI::common::FETCH, avg 512ns/call
95
9620002.32ms if ( $s_error ) {
97 require Carp;
98 Carp::confess("transaction failed: $s_error");
99 $or_self->{dbh}->rollback();
100 }
101 else {
102200022.4s200022.4s $or_self->{dbh}->commit();
# spent 22.4s making 2000 calls to DBI::db::commit, avg 11.2ms/call
103 }
104
1052000278ms2000214ms $or_self->{dbh}{AutoCommit} = $or_self->{old_AutoCommit};
# spent 214ms making 2000 calls to DBI::common::STORE, avg 107µs/call
106
107 }
108
109200024.3ms return 1;
110
111}
112
11312µs1;
114
115__END__