[Koha-bugs] [Bug 17941] CanBookBeRenewed is very inefficient/slow

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 1 14:58:48 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17941

--- Comment #3 from Petter Goksøyr Åsen <boutrosboutrosboutros at gmail.com> ---
Hi Jonathan. Thanks for looking into this!
We were actually working on this problem right now, so I have some information.
The code in question is quite complicated, so I'm not sure I understand it, but
it seems that the pathological cases are when most of the items are checked
out, so it needs to check every permutation of item, hold, and borrower to
check if it can be renewed. But I'm not 100% sure about it.

Rather than trying to understand how all the holds logic work in order to fix
this properly, we have made a patch now, that greatly improves the speed. This
is done by memoizing idempotent DB calls (GetItem, GetMembers and so on),
during the scope of CanBookBeRenewed. It helps a lot, because sometimes the
same item is fetched again and again, 100s to even 1000s of times from the DB!

In one case, by using the patch, the display of checkout tab with 5 items goes
from around 20 seconds to 3 seconds, 

We do belive this patch is a good step forward, but we will test it extensivly
in staging environment before we submit it.

I'll try see if I can get some interesting result from your script.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list