[Bug 35899] New: Performance improvements for build_holds_queue
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35899 Bug ID: 35899 Summary: Performance improvements for build_holds_queue Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Hold requests Assignee: koha-bugs@lists.koha-community.org Reporter: andreas.jonsson@kreablo.se QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com On a large and busy system the holds queue can take several minutes to build adding a significant load to the database and koha server. I have profiled the script and have noticed two major inefficiencies: 1. Calls to C4::Circulation::GetBranchItemRule constitute roughly 35% of the runtime. But this method can easily be memoized. 2. With LocalHoldsPriority enabled, expensive checks are made for all available items, even if it is only relevant to do these checks for local items. Depending on how the system is configured, either the unnecessary loading of patron objects, or calls to _checkHoldPolicy can take considerable time. I have prepared two patches which together cuts the runtime of the script with abouth 50% if LocalHoldsPriority is enabled. Profiling result before: https://bv-test-opac.biblioteket.nu/resources/before/index.html Profiling result after: https://bv-test-opac.biblioteket.nu/resources/after/index.html -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35899 --- Comment #1 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 161358 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161358&action=edit Bug 35899: memoize C4::Circulation::GetBranchItemRule when building holds queue Test plan: * Examine patches and make sure they do not alter the functionality (provided there are no unexpected side effects in called subroutines) * Run prove t/db_dependent/HoldsQueue.t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35899 --- Comment #2 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 161359 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161359&action=edit Bug 35899: don't perform expensive checks on non-local items when examining local items -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35899 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #161358|0 |1 is obsolete| | --- Comment #3 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 161360 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161360&action=edit Bug 35899: memoize C4::Circulation::GetBranchItemRule when building holds queue Test plan: * Examine patches and make sure they do not alter the functionality (provided there are no unexpected side effects in called subroutines) * Run prove t/db_dependent/HoldsQueue.t -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35899 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35899 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #161359|0 |1 is obsolete| | --- Comment #4 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 164969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164969&action=edit Bug 35899: don't perform expensive checks on non-local items when examining local items -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35899 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #161360|0 |1 is obsolete| | --- Comment #5 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 164970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164970&action=edit Bug 35899: memoize C4::Circulation::GetBranchItemRule when building holds queue Test plan: * Examine patches and make sure they do not alter the functionality (provided there are no unexpected side effects in called subroutines) * Run prove t/db_dependent/HoldsQueue.t -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35899 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org Assignee|koha-bugs@lists.koha-commun |andreas.jonsson@kreablo.se |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35899 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org