← 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 11:58:52 2013
Reported on Tue Oct 15 12:02:27 2013

Filename/usr/share/perl5/CGI/Session/Driver/mysql.pm
StatementsExecuted 48 statements in 13.0ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.90ms3.30msCGI::Session::Driver::mysql::::BEGIN@7CGI::Session::Driver::mysql::BEGIN@7
311170µs12.1msCGI::Session::Driver::mysql::::storeCGI::Session::Driver::mysql::store
31184µs114µsCGI::Session::Driver::mysql::::initCGI::Session::Driver::mysql::init
31165µs103µsCGI::Session::Driver::mysql::::table_nameCGI::Session::Driver::mysql::table_name
11136µs44µsCGI::Session::Driver::mysql::::BEGIN@5CGI::Session::Driver::mysql::BEGIN@5
11125µs147µ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
5354µs253µs
# spent 44µs (36+9) within CGI::Session::Driver::mysql::BEGIN@5 which was called: # once (36µs+9µs) by CGI::Session::_load_pluggables at line 5
use strict;
# spent 44µs making 1 call to CGI::Session::Driver::mysql::BEGIN@5 # spent 9µs making 1 call to strict::import
6367µs2270µs
# spent 147µs (25+123) within CGI::Session::Driver::mysql::BEGIN@6 which was called: # once (25µs+123µs) by CGI::Session::_load_pluggables at line 6
use Carp;
# spent 147µs making 1 call to CGI::Session::Driver::mysql::BEGIN@6 # spent 122µs making 1 call to Exporter::import
73775µs13.30ms
# spent 3.30ms (1.90+1.40) within CGI::Session::Driver::mysql::BEGIN@7 which was called: # once (1.90ms+1.40ms) by CGI::Session::_load_pluggables at line 7
use CGI::Session::Driver::DBI;
# spent 3.30ms making 1 call to CGI::Session::Driver::mysql::BEGIN@7
8
9119µs@CGI::Session::Driver::mysql::ISA = qw( CGI::Session::Driver::DBI );
1011µs$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 114µs (84+30) within CGI::Session::Driver::mysql::init which was called 3 times, avg 38µs/call: # 3 times (84µs+30µs) by CGI::Session::Driver::new at line 38 of CGI/Session/Driver.pm, avg 38µs/call
sub init {
3333µs my $self = shift;
3435µs if ( $self->{DataSource} && ($self->{DataSource} !~ /^dbi:mysql/i) ) {
35 $self->{DataSource} = "dbi:mysql:database=" . $self->{DataSource};
36 }
37
3833µs if ( $self->{Socket} && $self->{DataSource} ) {
39 $self->{DataSource} .= ';mysql_socket=' . $self->{Socket};
40 }
41365µs330µs return $self->SUPER::init();
# spent 30µs making 3 calls to CGI::Session::Driver::DBI::init, avg 10µs/call
42}
43
44
# spent 12.1ms (170µs+11.9) within CGI::Session::Driver::mysql::store which was called 3 times, avg 4.02ms/call: # 3 times (170µs+11.9ms) by CGI::Session::flush at line 253 of CGI/Session.pm, avg 4.02ms/call
sub store {
4533µs my $self = shift;
4638µs my ($sid, $datastr) = @_;
4732µs croak "store(): usage error" unless $sid && $datastr;
48
4935µs my $dbh = $self->{Handle};
50311.9ms611.9ms $dbh->do("INSERT INTO " . $self->table_name .
# spent 11.8ms making 3 calls to DBI::db::do, avg 3.93ms/call # spent 103µs making 3 calls to CGI::Session::Driver::mysql::table_name, avg 34µ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 );
54350µs return 1;
55}
56
57
58
# spent 103µs (65+38) within CGI::Session::Driver::mysql::table_name which was called 3 times, avg 34µs/call: # 3 times (65µs+38µs) by CGI::Session::Driver::mysql::store at line 50, avg 34µs/call
sub table_name {
5933µs my $self = shift;
60
61357µs338µs return $self->SUPER::table_name(@_);
# spent 38µs making 3 calls to CGI::Session::Driver::DBI::table_name, avg 13µs/call
62}
63
6416µs1;
65
66__END__;