[Bug 7073] New: GetCOinSBiblio should take $record, not $biblionumber
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 Bug #: 7073 Summary: GetCOinSBiblio should take $record, not $biblionumber Classification: Unclassified Change sponsored?: --- Product: Koha Version: unspecified Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P5 Component: Architecture, internals, and plumbing AssignedTo: ian.walls@bywatersolutions.com ReportedBy: ian.walls@bywatersolutions.com QAContact: koha-bugs@lists.koha-community.org GetCOinSBiblio is summoned three places in Koha so far: C4::VirtualShelves/Page.pm, opac/opac-search.pl and opac/opac-detail.pl. It takes in a biblionumber, then immediately calls GetMarcBiblio on that to get the record. This is a very expensive call. The kicker is that in 2 of the 3 contexts, we've ALREADY GOT the $record. We're pulling it in twice per title, and the number of titles we loop through is either OPACnumsearchresults or numsearchresults. The default of 20 has us making 40 calls to GetMarcBiblio... at several dozen milliseconds per call, that's a lot of time! If we change the GetCOinSBbiblio routine to take in a $record object instead, we save those calls on Lists and opac/opac-detail.pl. We'd just need to call GetMarcBiblio in the search results before calling GetCOinSBiblio... which is just moving the call from inside the subroutine to outside (no performance loss). Patch forthcoming. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 --- Comment #1 from Ian Walls <ian.walls@bywatersolutions.com> 2011-10-20 20:11:10 UTC --- Created attachment 6014 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=6014 Proposed Patch This patch changes the GetCOinsBiblio subroutine to take a MARC record object (as returned from GetMarcBiblio) instead of a biblionumber. The first thing the subroutine did was GetMarcBiblio, and the $biblionumber passed was never used again. This subroutine was only used 3 places: opac/opac-search.pl, opac/opac-detail.pl, and C4/VirtualShelves/Page.pm. In the first and last cases, it was used in a loop. In the last two cases, a call to GetMarcBiblio had already been done. This is expensive, and we were doing it twice per record. For opac/opac-search.pl, the call to GetMarcBiblio was moved to just outside GetCOinSBiblio; this will not change the performance at all. But for opac/opac-detail.pl and C4/VirtualShelves/Page.pm, a redudant call to GetMarcBiblio is now avoided. To Test: 1. Enable COinSinOPACResults in system preferences. Perform a search in the OPAC. Verify that the COinS spans are showing up 2. View the detail record of one of the returned items. Confirm that the COinS span exists on the detail page. 3. View a list in the OPAC. Confirm that COinS spans are still showing up -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 |PATCH-Sent Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |5729 -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |Rel_3_8 --- Comment #2 from Paul Poulain <paul.poulain@biblibre.com> 2011-10-24 11:38:19 UTC --- Updating Version : This ENH will be for Koha 3.8 -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|Rel_3_8 |master --- Comment #3 from Paul Poulain <paul.poulain@biblibre.com> 2011-10-25 15:05:56 UTC --- Bug versionned for master. entries will be made against rel_3_8 once the patch has been applied (see thread about that on koha-devel yesterday) -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #6014|0 |1 is obsolete| | --- Comment #4 from Chris Cormack <chris@bigballofwax.co.nz> 2011-11-04 02:54:00 UTC --- Created attachment 6174 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=6174 Bug 7073: GetCOinSBiblio should take $record object, not biblionumber This patch changes the GetCOinsBiblio subroutine to take a MARC record object (as returned from GetMarcBiblio) instead of a biblionumber. The first thing the subroutine did was GetMarcBiblio, and the $biblionumber passed was never used again. This subroutine was only used 3 places: opac/opac-search.pl, opac/opac-detail.pl, and C4/VirtualShelves/Page.pm. In the first and last cases, it was used in a loop. In the last two cases, a call to GetMarcBiblio had already been done. This is expensive, and we were doing it twice per record. For opac/opac-search.pl, the call to GetMarcBiblio was moved to just outside GetCOinSBiblio; this will not change the performance at all. But for opac/opac-detail.pl and C4/VirtualShelves/Page.pm, a redudant call to GetMarcBiblio is now avoided. To Test: 1. Enable COinSinOPACResults in system preferences. Perform a search in the OPAC. Verify that the COinS spans are showing up 2. View the detail record of one of the returned items. Confirm that the COinS span exists on the detail page. 3. View a list in the OPAC. Confirm that COinS spans are still showing up Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Patch Status|Needs Signoff |Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 Ian Walls <ian.walls@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QAContact|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | --- Comment #5 from Ian Walls <ian.walls@bywatersolutions.com> 2011-11-19 23:50:47 UTC --- Assigning to M. de Rooy for QA -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA Contact for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Patch Status|Signed Off |Passed QA --- Comment #6 from M. de Rooy <m.de.rooy@rijksmuseum.nl> 2011-11-23 14:54:10 UTC --- QA: Code looks good. Should benefit performance. Well documented. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7073 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.poulain@biblibre.com Version|master |rel_3_8 Patch Status|Passed QA |Patch Pushed --- Comment #7 from Paul Poulain <paul.poulain@biblibre.com> 2011-11-24 10:45:15 UTC --- I checked with a grep that there were no other calls to GetCOinSBiblio, that's the case. Patch pushed, please test. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org