This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rate qudo_skinny the_schwartz qudo_skinny_cached qudo_dbi the_schwartz_cached jonk the_schwartz_simple qudo_dbi_cached jonk_cached the_schwartz_simple_cached | |
qudo_skinny 595/s -- -23% -56% -56% -64% -72% -75% -84% -91% -94% | |
the_schwartz 774/s 30% -- -43% -43% -53% -64% -67% -79% -88% -93% | |
qudo_skinny_cached 1348/s 126% 74% -- -1% -18% -37% -43% -64% -79% -87% | |
qudo_dbi 1362/s 129% 76% 1% -- -17% -37% -43% -63% -79% -87% | |
the_schwartz_cached 1650/s 177% 113% 22% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nekokak@imac]$ git diff [/Users/nekokak/project/github/p5-Teng] 11-01-26 12:35 | |
diff --git a/lib/Teng.pm b/lib/Teng.pm | |
index 44a63e3..a639dd4 100644 | |
--- a/lib/Teng.pm | |
+++ b/lib/Teng.pm | |
@@ -111,7 +111,7 @@ sub connect { | |
sub reconnect { | |
my $self = shift; | |
- if ($self->txn_manager->in_transaction) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! perl | |
use strict; | |
use warnings; | |
use Benchmark qw(timethese cmpthese); | |
use DBI; | |
use Data::Dumper; | |
{ | |
package SKN; | |
use DBIx::Skinny; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my @columns = ( | |
'id', | |
{ | |
name => 'uid', | |
type => 'bigint', | |
}, | |
'name', | |
{ | |
name => 'body', | |
type => 'blob', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ # savepoint | |
my $session = $mapper->begin_session( autocommit => 0 ); | |
$session->add( My::PgTest->new( i => 11 ) ); | |
eval { | |
$session->txn( | |
sub { | |
$session->add( My::PgTest->new( id => 1, i => 11 ) ); | |
eval { | |
$session->txn( | |
sub { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $tnx = $tm->txn->scope({with_save_point=>1}); | |
my $sp1 = $tnx->mark_savepoint; | |
$dbh->execute(); | |
my $sp2 = $tnx->mark_savepoint; | |
try { | |
$dbh->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/DBIx/ObjectMapper.pm b/lib/DBIx/ObjectMapper.pm | |
index 81564f5..8568a1d 100644 | |
--- a/lib/DBIx/ObjectMapper.pm | |
+++ b/lib/DBIx/ObjectMapper.pm | |
@@ -117,7 +117,7 @@ Create a engine and a mapper object. | |
use DBIx::ObjectMapper::Engine::DBI; | |
my $engine = DBIx::ObjectMapper::Engine::DBI->new({ | |
- dsn => 'DBD:SQLite:', | |
+ dsn => 'dbi:SQLite:', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use DBI; | |
my $dbh = DBI->connect('dbi:mysql:foo','root',''); | |
my $sth = $dbh->prepare('select * from job where func = ?'); | |
$sth->{Callbacks} = { | |
execute => sub { | |
my ($obj, $binds) = @_; | |
my $stmt = $obj->{Database}->{Statement}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub schema_info { | |
my $self = shift; | |
if (my $table = $self->{opt_table_info}) { | |
return $self->{skinny}->schema->schema_info->{$table}; | |
} else { | |
return $self->{skinny}->schema->schema_info; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./xt/postgresql.t .. NOTICE: CREATE TABLE will create implicit sequence "job_id_seq" for serial column "job.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "job_pkey" for table "job" | |
./xt/postgresql.t .. 1/? NOTICE: CREATE TABLE will create implicit sequence "job_id_seq" for serial column "job.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "job_pkey" for table "job" | |
./xt/postgresql.t .. ok |