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
#!/usr/bin/perl | |
use C4::Context; | |
use Koha::BiblioUtils; | |
my $records = Koha::BiblioUtils->get_all_biblios_iterator({ batched => 1 }); | |
$limit = 10000; | |
while ($limit--) { | |
$records->next(); | |
} |
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
#!/usr/bin/perl | |
use C4::Context; | |
use C4::Biblio; | |
use C4::Items; | |
use t::lib::Mocks; | |
use Time::HiRes qw(gettimeofday tv_interval); | |
use List::MoreUtils qw(natatime); | |
t::lib::Mocks::mock_preference('item-level_itypes', '1'); | |
my $itemnumbers = C4::Context->dbh->selectcol_arrayref(qq{SELECT itemnumber FROM items LIMIT 2000}); |
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
#!/usr/bin/perl | |
use C4::Context; | |
use C4::Biblio; | |
use C4::Items; | |
use t::lib::Mocks; | |
use Time::HiRes qw(gettimeofday tv_interval); | |
t::lib::Mocks::mock_preference('item-level_itypes', '1'); | |
my $itemnumbers = C4::Context->dbh->selectcol_arrayref(qq{SELECT itemnumber FROM items WHERE biblionumber = 2}); |
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 GetItems { | |
my ($itemnumbers, $barcodes, $serial) = @_; | |
my $dbh = C4::Context->dbh; | |
my $items_data = []; | |
# Important: If 'item-level_itypes' preference is not set Koha::Item::effective_itemtype() | |
# will be equal to $item->{itype} and it is possible to fetch the data directly from items table. | |
# This will have a much smaller footprint then unblessing the item objects fetched through | |
# find/search. If more calculated attributes are added in the future, this code will need | |
# to account for that. |
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
#!/usr/bin/perl | |
use C4::Context; | |
use C4::Biblio; | |
use C4::Items; | |
use t::lib::Mocks; | |
use Time::HiRes qw(gettimeofday tv_interval); | |
t::lib::Mocks::mock_preference('item-level_itypes', '1'); | |
my $result = C4::Context->dbh->selectcol_arrayref(qq{SELECT itemnumber FROM items LIMIT 1}); |
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
#!/usr/bin/perl | |
use C4::Context; | |
use C4::Biblio; | |
use t::lib::Mocks; | |
my $biblionumber = <biblionumber_with_items_goes_here>; | |
# Warm up caches to get a more fair benchmark | |
GetMarcBiblio({biblionumber => $biblionumber, embed_items => 1}); | |
DB::enable_profile(); |
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
#!/usr/bin/perl | |
use C4::Biblio; | |
$i = 50000; | |
while($i--) { | |
C4::Biblio::GetMarcSubfieldStructure('', {unsafe => 1}); | |
} |
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
#!/usr/bin/perl | |
use C4::Context; | |
use C4::Biblio; | |
my $biblio_ids = C4::Context->dbh->selectcol_arrayref(qq{SELECT biblionumber FROM biblio LIMIT 5000}); | |
foreach my $id (@{$biblio_ids}) { | |
GetMarcBiblio({biblionumber => $id, embed_items => 1}); | |
} |
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
#!/usr/bin/perl | |
use C4::Context; | |
my $i = 200000; | |
while($i--) { | |
C4::Context->dbh->selectcol_arrayref(qq{SELECT biblionumber FROM biblio LIMIT 1}); | |
} |