Bugzilla – Attachment 57636 Details for
Bug 14736
AllowRenewalIfOtherItemsAvailable slows circulation down in case of a record with many items and many holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a record with many items and many holds
Bug-14736---AllowRenewalIfOtherItemsAvailable-slow.patch (text/plain), 2.78 KB, created by
Jonathan Druart
on 2016-11-18 10:28:17 UTC
(
hide
)
Description:
Bug 14736 - AllowRenewalIfOtherItemsAvailable slows circulation down in case of a record with many items and many holds
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-11-18 10:28:17 UTC
Size:
2.78 KB
patch
obsolete
>From 967c6fb4397dafe6213982d5bfabcc0747d3e711 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 24 Aug 2016 11:13:48 +0000 >Subject: [PATCH] Bug 14736 - AllowRenewalIfOtherItemsAvailable slows > circulation down in case of a record with many items and many holds > >If the AllowRenewalIfOtherItemsAvailable sys pref is set to allow, and a >borrower has an item checked out that has many items {30+} AND many >holds {70+) on it, loading the checkouts table for this borrower takes >FOREVER to load. The load time takes forever, because of the >factoring that happens to determine if an item is truly >available for renewal. > >This patch swaps the use of GetMemberDetails for GetMember >and reorders the subroutine calls to check each items' renewability >from fastest to slowest. > >In a test case, the results of pre patch were: >Start of loop: 2016-08-24T11:05:14 >End of loop: 2016-08-24T11:05:29 >Resulting in 15 seconds being spent in the loop > >Post patch results were: >Start of loop: 2016-08-24T11:08:43 >End of loop: 2016-08-24T11:08:48 >Resulting in only 5 seconds being spent in the loop! > >Test Plan: >1) Apply this patch >2) Note there are no changes in functionality for the renewals column of > the patron checkouts table. > >If you wish to go further and test the performance benefit: >1) Create a record with 50 items and 100 holds ( 50 waiting, 50 unfilled ) >2) Check out one of the waiting holds to a patron >3) Time the amount of time it takes for the checkouts table to load >4) Apply this patch >5) Repeat step 3, you should see an improvement in load time > >Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Circulation.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 9e085ef..b505031 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2779,12 +2779,12 @@ sub CanBookBeRenewed { > # by pushing all the elements onto an array and removing the duplicates. > my @reservable; > foreach my $b (@borrowernumbers) { >- my ($borr) = C4::Members::GetMemberDetails($b); >+ my ($borr) = C4::Members::GetMember( borrowernumber => $b); > foreach my $i (@itemnumbers) { > my $item = GetItem($i); >- if ( IsAvailableForItemLevelRequest( $item, $borr ) >- && CanItemBeReserved( $b, $i ) >- && !IsItemOnHoldAndFound($i) ) >+ if ( !IsItemOnHoldAndFound($i) >+ && IsAvailableForItemLevelRequest( $item, $borr ) >+ && CanItemBeReserved( $b, $i ) ) > { > push( @reservable, $i ); > } >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14736
:
54813
|
56463
| 57636