[Bug 26424] New: Better performance of svc/checkouts
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Bug ID: 26424 Summary: Better performance of svc/checkouts Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Ajax script svc/checkouts display checkouts of a patron. For each item, it fetches a Koha::ItemType object and a Koha::AuthorisedValues object for location,ccode,lost and damaged. For performance on huge number of checkouts : Item types should be fetch once before the loop. authorised values should call Koha::AuthorisedValues->get_description_by_koha_field because it uses a cache. -- 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=26424 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |fridolin.somers@biblibre.co |ity.org |m -- 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=26424 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26323 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 --- Comment #1 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 109850 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109850&action=edit Bug 26424: Better performance of svc/checkouts Ajax script svc/checkouts display checkouts of a patron. For each item, it fetches a Koha::ItemType object and a Koha::AuthorisedValues object for location,ccode,lost and damaged. For performance on huge number of checkouts : Item types should be fetch once before the loop. authorised values should call Koha::AuthorisedValues->get_description_by_koha_field because it uses a cache. Test plan : 1) Dont apply patch 2) Use sql to define some items lost and damaged 3) Look at checkouts table on a patron with a lot of checkouts 4) Apply patch 5) Look at checkouts table again and check info are the same : record level item type, item type, location, collection, lost, damaged -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109850|0 |1 is obsolete| | --- Comment #2 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 109851 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109851&action=edit Bug 26424: Better performance of svc/checkouts Ajax script svc/checkouts display checkouts of a patron. For each item, it fetches a Koha::ItemType object and a Koha::AuthorisedValues object for location,ccode,lost and damaged. For performance on huge number of checkouts : Item types should be fetch once before the loop. authorised values should call Koha::AuthorisedValues->get_description_by_koha_field because it uses a cache. I've tested with Plack : Without patch : 100 checkouts = 6 seconds 1000 checkouts = 60 seconds With patch : 100 checkouts = 5 seconds 1000 checkouts = 44 seconds Test plan : 1) Dont apply patch 2) Use sql to define some items lost and damaged 3) Look at checkouts table on a patron with a lot of checkouts 4) Apply patch 5) Look at checkouts table again 6) Check infos are the same : record level item type, item type, location, collection, lost, damaged 7) Check infos are the same in "Number of checkouts by item type" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- It's ok, but we should use the REST API sooner than later. We can embed things, etc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 --- Comment #4 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- (In reply to Tomás Cohen Arazi from comment #3)
It's ok, but we should use the REST API sooner than later. We can embed things, etc.
Yep indeed, but that will be a lot of work, this table is really complex. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 --- Comment #5 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Ah patch also changes the fact that authorised value categories are no longer hardcoded LOC,CCODE,LOST and DAMAGED, they depend on default framework. Like is doing Bug 26323 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109851|0 |1 is obsolete| | --- Comment #6 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 109883 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109883&action=edit Bug 26424: Better performance of svc/checkouts Ajax script svc/checkouts display checkouts of a patron. For each item, it fetches a Koha::ItemType object and a Koha::AuthorisedValues object for location,ccode,lost and damaged. For performance on huge number of checkouts : Item types should be fetch once before the loop. authorised values should call Koha::AuthorisedValues->get_description_by_koha_field because it uses a cache. I've tested with Plack : Without patch : 100 checkouts = 6 seconds 1000 checkouts = 60 seconds With patch : 100 checkouts = 5 seconds 1000 checkouts = 44 seconds Patch also changes the fact that authorised value categories are no longer hardcoded LOC,CCODE,LOST and DAMAGED, they depend on default framework. Like is doing Bug 26323. Test plan : 1) Dont apply patch 2) Use sql to define some items lost and damaged 3) Look at checkouts table on a patron with a lot of checkouts 4) Apply patch 5) Look at checkouts table again 6) Check infos are the same : record level item type, item type, location, collection, lost, damaged 7) Check infos are the same in "Number of checkouts by item type" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109883|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 110209 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110209&action=edit Bug 26424: Better performance of svc/checkouts Ajax script svc/checkouts display checkouts of a patron. For each item, it fetches a Koha::ItemType object and a Koha::AuthorisedValues object for location,ccode,lost and damaged. For performance on huge number of checkouts : Item types should be fetch once before the loop. authorised values should call Koha::AuthorisedValues->get_description_by_koha_field because it uses a cache. I've tested with Plack : Without patch : 100 checkouts = 6 seconds 1000 checkouts = 60 seconds With patch : 100 checkouts = 5 seconds 1000 checkouts = 44 seconds Patch also changes the fact that authorised value categories are no longer hardcoded LOC,CCODE,LOST and DAMAGED, they depend on default framework. Like is doing Bug 26323. Test plan : 1) Dont apply patch 2) Use sql to define some items lost and damaged 3) Look at checkouts table on a patron with a lot of checkouts 4) Apply patch 5) Look at checkouts table again 6) Check infos are the same : record level item type, item type, location, collection, lost, damaged 7) Check infos are the same in "Number of checkouts by item type" Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |martin.renvoize@ptfs-europe | |.com --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Clear and sensible improvement works as expected. Signing off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Please check the fail from the QA script: FAIL svc/checkouts FAIL critic # Variables::ProhibitConditionalDeclarations: Got 2 violation(s). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110209|0 |1 is obsolete| | --- Comment #10 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 110378 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110378&action=edit Bug 26424: Better performance of svc/checkouts Ajax script svc/checkouts display checkouts of a patron. For each item, it fetches a Koha::ItemType object and a Koha::AuthorisedValues object for location,ccode,lost and damaged. For performance on huge number of checkouts : Item types should be fetch once before the loop. authorised values should call Koha::AuthorisedValues->get_description_by_koha_field because it uses a cache. I've tested with Plack : Without patch : 100 checkouts = 6 seconds 1000 checkouts = 60 seconds With patch : 100 checkouts = 5 seconds 1000 checkouts = 44 seconds Patch also changes the fact that authorised value categories are no longer hardcoded LOC,CCODE,LOST and DAMAGED, they depend on default framework. Like is doing Bug 26323. Test plan : 1) Dont apply patch 2) Use sql to define some items lost and damaged 3) Look at checkouts table on a patron with a lot of checkouts 4) Apply patch 5) Look at checkouts table again 6) Check infos are the same : record level item type, item type, location, collection, lost, damaged 7) Check infos are the same in "Number of checkouts by item type" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 --- Comment #11 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- (In reply to Katrin Fischer from comment #9)
Please check the fail from the QA script:
FAIL svc/checkouts FAIL critic # Variables::ProhibitConditionalDeclarations: Got 2 violation(s).
Oh indeed i see. Its a minor change : - my $type_for_stat = Koha::ItemTypes->find( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); - my $itemtype = Koha::ItemTypes->find( $c->{itype} ); - my $recordtype = Koha::ItemTypes->find( $c->{itemtype} ); + my ( $itemtype, $recordtype, $type_for_stat ); + $itemtype = $itemtypes->{ $c->{itype} } if $c->{itype}; + $recordtype = $itemtypes->{ $c->{itemtype} } if $c->{itemtype}; + $type_for_stat = $item_level_itypes ? $itemtype : $recordtype; I replaced the patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110378|0 |1 is obsolete| | --- Comment #12 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 110379 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110379&action=edit Bug 26424: Better performance of svc/checkouts Ajax script svc/checkouts display checkouts of a patron. For each item, it fetches a Koha::ItemType object and a Koha::AuthorisedValues object for location,ccode,lost and damaged. For performance on huge number of checkouts : Item types should be fetch once before the loop. authorised values should call Koha::AuthorisedValues->get_description_by_koha_field because it uses a cache. I've tested with Plack : Without patch : 100 checkouts = 6 seconds 1000 checkouts = 60 seconds With patch : 100 checkouts = 5 seconds 1000 checkouts = 44 seconds Patch also changes the fact that authorised value categories are no longer hardcoded LOC,CCODE,LOST and DAMAGED, they depend on default framework. Like is doing Bug 26323. Test plan : 1) Dont apply patch 2) Use sql to define some items lost and damaged 3) Look at checkouts table on a patron with a lot of checkouts 4) Apply patch 5) Look at checkouts table again 6) Check infos are the same : record level item type, item type, location, collection, lost, damaged 7) Check infos are the same in "Number of checkouts by item type" Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26393 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110379|0 |1 is obsolete| | --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 110429 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110429&action=edit Bug 26424: Better performance of svc/checkouts Ajax script svc/checkouts display checkouts of a patron. For each item, it fetches a Koha::ItemType object and a Koha::AuthorisedValues object for location,ccode,lost and damaged. For performance on huge number of checkouts : Item types should be fetch once before the loop. authorised values should call Koha::AuthorisedValues->get_description_by_koha_field because it uses a cache. I've tested with Plack : Without patch : 100 checkouts = 6 seconds 1000 checkouts = 60 seconds With patch : 100 checkouts = 5 seconds 1000 checkouts = 44 seconds Patch also changes the fact that authorised value categories are no longer hardcoded LOC,CCODE,LOST and DAMAGED, they depend on default framework. Like is doing Bug 26323. Test plan : 1) Dont apply patch 2) Use sql to define some items lost and damaged 3) Look at checkouts table on a patron with a lot of checkouts 4) Apply patch 5) Look at checkouts table again 6) Check infos are the same : record level item type, item type, location, collection, lost, damaged 7) Check infos are the same in "Number of checkouts by item type" Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|20.11.00 |20.11.00, 20.05.05 released in| | CC| |lucas@bywatersolutions.com --- Comment #15 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26424 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz Severity|normal |enhancement --- Comment #16 from Aleisha Amohia <aleisha@catalyst.net.nz> --- enhancement, not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org