← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:51 2015

Filename/usr/share/perl5/CGI/Session/Driver/mysql.pm
StatementsExecuted 23 statements in 3.91ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.12ms3.50msCGI::Session::Driver::mysql::::BEGIN@7CGI::Session::Driver::mysql::BEGIN@7
11123µs29µsCGI::Session::Driver::mysql::::initCGI::Session::Driver::mysql::init
11116µs2.58msCGI::Session::Driver::mysql::::storeCGI::Session::Driver::mysql::store
11116µs28µsCGI::Session::Driver::mysql::::BEGIN@5CGI::Session::Driver::mysql::BEGIN@5
22212µs18µsCGI::Session::Driver::mysql::::table_nameCGI::Session::Driver::mysql::table_name
1118µs44µ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$
4
5225µs241µs
# spent 28µs (16+13) within CGI::Session::Driver::mysql::BEGIN@5 which was called: # once (16µs+13µs) by CGI::Session::_load_pluggables at line 5
use strict;
# spent 28µs making 1 call to CGI::Session::Driver::mysql::BEGIN@5 # spent 13µs making 1 call to strict::import
6227µs280µs
# spent 44µs (8+36) within CGI::Session::Driver::mysql::BEGIN@6 which was called: # once (8µs+36µs) by CGI::Session::_load_pluggables at line 6
use Carp;
# spent 44µs making 1 call to CGI::Session::Driver::mysql::BEGIN@6 # spent 36µs making 1 call to Exporter::import
721.24ms13.50ms
# spent 3.50ms (2.12+1.39) within CGI::Session::Driver::mysql::BEGIN@7 which was called: # once (2.12ms+1.39ms) by CGI::Session::_load_pluggables at line 7
use CGI::Session::Driver::DBI;
# spent 3.50ms making 1 call to CGI::Session::Driver::mysql::BEGIN@7
8
9110µs@CGI::Session::Driver::mysql::ISA = qw( CGI::Session::Driver::DBI );
101300ns$CGI::Session::Driver::mysql::VERSION = '4.43';
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 29µs (23+6) within CGI::Session::Driver::mysql::init which was called: # once (23µs+6µs) by CGI::Session::Driver::new at line 36 of CGI/Session/Driver.pm
sub init {
3312µs my $self = shift;
3419µs if ( $self->{DataSource} && ($self->{DataSource} !~ /^dbi:mysql/i) ) {
35 $self->{DataSource} = "dbi:mysql:database=" . $self->{DataSource};
36 }
37
381300ns if ( $self->{Socket} && $self->{DataSource} ) {
39 $self->{DataSource} .= ';mysql_socket=' . $self->{Socket};
40 }
41112µs16µs return $self->SUPER::init();
# spent 6µs making 1 call to CGI::Session::Driver::DBI::init
42}
43
44
# spent 2.58ms (16µs+2.56) within CGI::Session::Driver::mysql::store which was called: # once (16µs+2.56ms) by CGI::Session::flush at line 251 of CGI/Session.pm
sub store {
451500ns my $self = shift;
461600ns my ($sid, $datastr) = @_;
471300ns croak "store(): usage error" unless $sid && $datastr;
48
491500ns my $dbh = $self->{Handle};
5012.57ms22.56ms $dbh->do("INSERT INTO " . $self->table_name .
# spent 2.56ms making 1 call to DBI::db::do # spent 5µs making 1 call to CGI::Session::Driver::mysql::table_name
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 );
5414µs return 1;
55}
56
57
58
# spent 18µs (12+6) within CGI::Session::Driver::mysql::table_name which was called 2 times, avg 9µs/call: # once (9µs+4µs) by CGI::Session::Driver::DBI::retrieve at line 68 of CGI/Session/Driver/DBI.pm # once (3µs+2µs) by CGI::Session::Driver::mysql::store at line 50
sub table_name {
592400ns my $self = shift;
60
61211µs26µs return $self->SUPER::table_name(@_);
# spent 6µs making 2 calls to CGI::Session::Driver::DBI::table_name, avg 3µs/call
62}
63
6414µs1;
65
66__END__;