https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20819
--- Comment #69 from Marcel de Rooy <[email protected]> --- use Modern::Perl; use Data::Dumper qw/Dumper/; use Test::More tests => 1; use Time::HiRes qw/time/; use t::lib::Mocks; use t::lib::TestBuilder; use Koha::Patron::Consents; my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; $schema->storage->txn_begin; subtest 'myTest' => sub { plan tests => 2; # Add 1000 consents my $firstid; foreach(1..100) { my $consent = $builder->build_object({ class => 'Koha::Patron::Consents' }); $firstid = $consent->borrowernumber if !$firstid; } my $set = Koha::Patron::Consents->search({ borrowernumber => $firstid }); #my $set = Koha::Patron::Consents->search; my $t1 = time; foreach(1..100) { my $i = $set->count; } my $t2 = time; is(1, 1, sprintf( "COUNT %6.4f\n", $t2 - $t1 ) ); $t1 = time; foreach(1..100) { my $i = $set->next; } #foreach(1..1000) { my $i = $set->next; #$set->_resultset->first unless $i; } $t2 = time; is(1, 1, sprintf( "NEXT %6.4f\n", $t2 - $t1 ) ); }; $schema->storage->txn_rollback; -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
