Skip to content

Commit

Permalink
Back out constructor/prefetch rewrite introduced mainly by 43245ad
Browse files Browse the repository at this point in the history
It was shipped against the authors advice, while containing multiple known
bugs. After the expected bugreports went warnocked for over two weeks by the
new DBIC release team, it seems that the only way to partially restore the
release quality DBIC users have come to expect, is to currently throw this
code away until better times.

Should resolve RT#78456 and the issues reported in these threads:
http://lists.scsys.co.uk/pipermail/dbix-class/2012-July/010681.html
http://lists.scsys.co.uk/pipermail/dbix-class/2012-July/010682.html
  • Loading branch information
ribasushi authored and Arthur Axel 'fREW' Schmidt committed Aug 23, 2012
1 parent 571df67 commit c973380
Show file tree
Hide file tree
Showing 34 changed files with 533 additions and 2,333 deletions.
35 changes: 12 additions & 23 deletions examples/Benchmarks/benchmark_datafetch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@
$schema->deploy;

my $rs = $schema->resultset ('Artist');

my $hri_rs = $rs->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' } );

#DB::enable_profile();
#my @foo = $hri_rs->all;
#DB::disable_profile();
#exit;
$rs->populate ([ map { { name => "Art_$_"} } (1 .. 10000) ]);

my $dbh = $schema->storage->dbh;
my $sql = sprintf ('SELECT %s FROM %s %s',
Expand All @@ -31,19 +25,14 @@
$rs->_resolved_attrs->{alias},
);

for (1,10,20,50,200,2500,10000) {
$rs->delete;
$rs->populate ([ map { { name => "Art_$_"} } (1 .. $_) ]);
print "\nRetrieval of $_ rows\n";
bench();
}

sub bench {
cmpthese(-3, {
Cursor => sub { my @r = $rs->cursor->all },
HRI => sub { my @r = $hri_rs->all },
RowObj => sub { my @r = $rs->all },
DBI_AoH => sub { my @r = @{ $dbh->selectall_arrayref ($sql, { Slice => {} }) } },
DBI_AoA=> sub { my @r = @{ $dbh->selectall_arrayref ($sql) } },
});
}
my $compdbi = sub {
my @r = $schema->storage->dbh->selectall_arrayref ('SELECT * FROM ' . ${$rs->as_query}->[0] )
} if $rs->can ('as_query');

cmpthese(-3, {
Cursor => sub { $rs->reset; my @r = $rs->cursor->all },
HRI => sub { $rs->reset; my @r = $rs->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' } )->all },
RowObj => sub { $rs->reset; my @r = $rs->all },
RawDBI => sub { my @r = $dbh->selectall_arrayref ($sql) },
$compdbi ? (CompDBI => $compdbi) : (),
});
Loading

0 comments on commit c973380

Please sign in to comment.