From: Peter Rabbitson Date: Sat, 20 Mar 2010 08:00:00 +0000 (+0000) Subject: Something is wrong with HRI inflation - too slow X-Git-Tag: v0.08121~51 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=caca5e1965638d5a4a84d9a15a33e7d3ca42790e;p=dbsrgits%2FDBIx-Class.git Something is wrong with HRI inflation - too slow --- diff --git a/maint/benchmark_datafetch.pl b/maint/benchmark_datafetch.pl new file mode 100755 index 0000000..7af9a30 --- /dev/null +++ b/maint/benchmark_datafetch.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../t/lib"; +use lib "$FindBin::Bin/../lib"; +use DBICTest; + +my $schema = DBICTest->init_schema(); +my $rs = $schema->resultset ('Artist'); +$rs->populate ([ map { { name => "Art_$_"} } (1 .. 3000) ]); + +use Benchmark qw/cmpthese/; + +cmpthese(-1, { + '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 }, +});