← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 17:10:45 2013
Reported on Tue Oct 15 17:11:27 2013

Filename/usr/share/perl5/CGI/Session/Driver/mysql.pm
StatementsExecuted 48 statements in 40.2ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.31ms2.12msCGI::Session::Driver::mysql::::BEGIN@7CGI::Session::Driver::mysql::BEGIN@7
311132µs39.5msCGI::Session::Driver::mysql::::storeCGI::Session::Driver::mysql::store
31196µs131µsCGI::Session::Driver::mysql::::initCGI::Session::Driver::mysql::init
31147µs70µsCGI::Session::Driver::mysql::::table_nameCGI::Session::Driver::mysql::table_name
11127µs35µsCGI::Session::Driver::mysql::::BEGIN@5CGI::Session::Driver::mysql::BEGIN@5
11114µs94µsCGI::Session::Driver::mysql::::BEGIN@6CGI::Session::Driver::mysql::BEGIN@6
0000s0sCGI::Session::Driver::mysql::::_mk_dsnstrCGI::Session::Driver::mysql::_mk_dsnstr
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package CGI::Session::Driver::mysql;
2
3# $Id: mysql.pm 447 2008-11-01 03:46:08Z markstos $
4
5335µs242µs
# spent 35µs (27+7) within CGI::Session::Driver::mysql::BEGIN@5 which was called: # once (27µs+7µs) by CGI::Session::_load_pluggables at line 5
use strict;
# spent 35µs making 1 call to CGI::Session::Driver::mysql::BEGIN@5 # spent 7µs making 1 call to strict::import
6348µs2173µs
# spent 94µs (14+80) within CGI::Session::Driver::mysql::BEGIN@6 which was called: # once (14µs+80µs) by CGI::Session::_load_pluggables at line 6
use Carp;
# spent 94µs making 1 call to CGI::Session::Driver::mysql::BEGIN@6 # spent 80µs making 1 call to Exporter::import
73523µs22.12ms
# spent 2.12ms (1.31+814µs) within CGI::Session::Driver::mysql::BEGIN@7 which was called: # once (1.31ms+814µs) by CGI::Session::_load_pluggables at line 7
use CGI::Session::Driver::DBI;
# spent 2.12ms making 1 call to CGI::Session::Driver::mysql::BEGIN@7 # spent 3µs making 1 call to UNIVERSAL::import
8
9113µs@CGI::Session::Driver::mysql::ISA = qw( CGI::Session::Driver::DBI );
101500ns$CGI::Session::Driver::mysql::VERSION = '4.38';
11
12sub _mk_dsnstr {
13 my ($class, $dsn) = @_;
14 unless ( $class && $dsn && ref($dsn) && (ref($dsn) eq 'HASH')) {
15 croak "_mk_dsnstr(): usage error";
16 }
17
18 my $dsnstr = $dsn->{DataSource};
19 if ( $dsn->{Socket} ) {
20 $dsnstr .= sprintf(";mysql_socket=%s", $dsn->{Socket});
21 }
22 if ( $dsn->{Host} ) {
23 $dsnstr .= sprintf(";host=%s", $dsn->{Host});
24 }
25 if ( $dsn->{Port} ) {
26 $dsnstr .= sprintf(";port=%s", $dsn->{Port});
27 }
28 return $dsnstr;
29}
30
31
32
# spent 131µs (96+34) within CGI::Session::Driver::mysql::init which was called 3 times, avg 44µs/call: # 3 times (96µs+34µs) by CGI::Session::Driver::new at line 38 of CGI/Session/Driver.pm, avg 44µs/call
sub init {
331288µs my $self = shift;
34 if ( $self->{DataSource} && ($self->{DataSource} !~ /^dbi:mysql/i) ) {
35 $self->{DataSource} = "dbi:mysql:database=" . $self->{DataSource};
36 }
37
38 if ( $self->{Socket} && $self->{DataSource} ) {
39 $self->{DataSource} .= ';mysql_socket=' . $self->{Socket};
40 }
41334µs return $self->SUPER::init();
# spent 34µs making 3 calls to CGI::Session::Driver::DBI::init, avg 11µs/call
42}
43
44
# spent 39.5ms (132µs+39.3) within CGI::Session::Driver::mysql::store which was called 3 times, avg 13.2ms/call: # 3 times (132µs+39.3ms) by CGI::Session::flush at line 253 of CGI/Session.pm, avg 13.2ms/call
sub store {
451839.4ms my $self = shift;
46 my ($sid, $datastr) = @_;
47 croak "store(): usage error" unless $sid && $datastr;
48
49 my $dbh = $self->{Handle};
50639.3ms $dbh->do("INSERT INTO " . $self->table_name .
# spent 39.3ms making 3 calls to DBI::db::do, avg 13.1ms/call # spent 70µs making 3 calls to CGI::Session::Driver::mysql::table_name, avg 23µs/call
51 " ($self->{IdColName}, $self->{DataColName}) VALUES(?, ?) ON DUPLICATE KEY UPDATE $self->{DataColName} = ?",
52 undef, $sid, $datastr, $datastr)
53 or return $self->set_error( "store(): \$dbh->do failed " . $dbh->errstr );
54 return 1;
55}
56
57
58
# spent 70µs (47+23) within CGI::Session::Driver::mysql::table_name which was called 3 times, avg 23µs/call: # 3 times (47µs+23µs) by CGI::Session::Driver::mysql::store at line 50, avg 23µs/call
sub table_name {
59644µs my $self = shift;
60
61323µs return $self->SUPER::table_name(@_);
# spent 23µs making 3 calls to CGI::Session::Driver::DBI::table_name, avg 8µs/call
62}
63
6414µs1;
65
66__END__;