Bug 30789: Improve performance of AddBiblio

AddBiblio calls TransformMarcRecordToKoha. We are only interested in getting biblio and biblioitems info, so we can pass 'no_items' to save some field lookups

Benchmarking saw a ~75% increase in the performance of this call

To test:
1 - Stage and import some records
2 - Confirm it works the same before and after patch
3 - Add a biblio via cataloguing, confirm it works

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2022-05-19 19:21:27 +00:00 committed by Tomas Cohen Arazi
parent 19068801ef
commit 24c4b408ff
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 1 deletions

View File

@ -220,7 +220,7 @@ sub AddBiblio {
# transform the data into koha-table style data
SetUTF8Flag($record);
my $olddata = TransformMarcToKoha( $record, $frameworkcode );
my $olddata = TransformMarcToKoha( $record, $frameworkcode, 'no_items' );
my $biblio = Koha::Biblio->new(
{