[Bug 36447] New: Circ rules slow to load when many itemtypes and categories
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Bug ID: 36447 Summary: Circ rules slow to load when many itemtypes and categories Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com It seems that we loop all categories and item types to build the circ matrix: 169 <tbody> 170 [% SET row_count = 0 %] 171 [% FOREACH c IN categorycodes %] 172 [% SET c = '' UNLESS c.defined %] 173 [% FOREACH i IN itemtypes %] This means that when we have a large number of both, the page becomes increasingly slow: Try loading the page several times, notings the load time Then: perl -e 'use t::lib::TestBuilder; my $builder=t::lib::TestBuilder->new(); for( my $i=0;$i<50;$i++){ $builder->build({ source=>"Itemtype"}); }' Note load times, then: perl -e 'use t::lib::TestBuilder; my $builder=t::lib::TestBuilder->new(); for( my $i=0;$i<50;$i++){ $builder->build({ source=>"Category"}); }' Note load times, then run each again NOte load times, I saw around 15 seconds when I had ~100 of each -- 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=36447 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |kyle.m.hall@gmail.com, | |martin.renvoize@ptfs-europe | |.com, tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Kyle M Hall <kyle@bywatersolutions.com> 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=36447 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 164065 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164065&action=edit Bug 36447: Circ rules slow to load when many itemtypes and categories It seems that we loop all categories and item types to build the circ matrix. We should only loop over values that have actually been used in circulation rules. Test Plan: 1) Create 1000 itemtypes and category codes. You can use the following script: use t::lib::TestBuilder; my $builder = t::lib::TestBuilder->new(); $builder->build( { source => 'Category' } ) for 0..1000; $builder->build( { source => 'Itemtype' } ) for 0..1000; 2) Note the lengthy load time for smart-rules.pl 3) Apply this patch 4) Restart all the things! 5) Reload the page 6) Note the much faster load time! -- 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=36447 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | CC| |kyle@bywatersolutions.com -- 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=36447 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164065|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 164083 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164083&action=edit Bug 36447: Circ rules slow to load when many itemtypes and categories It seems that we loop all categories and item types to build the circ matrix. We should only loop over values that have actually been used in circulation rules. Test Plan: 1) Create 1000 itemtypes and category codes. You can use the following script: use t::lib::TestBuilder; my $builder = t::lib::TestBuilder->new(); $builder->build( { source => 'Category' } ) for 0..1000; $builder->build( { source => 'Itemtype' } ) for 0..1000; 2) Note the lengthy load time for smart-rules.pl 3) Apply this patch 4) Restart all the things! 5) Reload the page 6) Note the much faster load time! Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164083|0 |1 is obsolete| | --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 164121 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164121&action=edit Bug 36447: Circ rules slow to load when many itemtypes and categories It seems that we loop all categories and item types to build the circ matrix. We should only loop over values that have actually been used in circulation rules. Test Plan: 1) Create 1000 itemtypes and category codes. You can use the following script: use t::lib::TestBuilder; my $builder = t::lib::TestBuilder->new(); $builder->build( { source => 'Category' } ) for 0..1000; $builder->build( { source => 'Itemtype' } ) for 0..1000; 2) Note the lengthy load time for smart-rules.pl 3) Apply this patch 4) Restart all the things! 5) Reload the page 6) Note the much faster load time! Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Evelyn Hartline <evelyn@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |evelyn@bywatersolutions.com --- Comment #5 from Evelyn Hartline <evelyn@bywatersolutions.com> --- Would it be possible to backport this for 23.11? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|24.05.00 |24.05.00,23.11.05 released in| | --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36673 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36673 [Bug 36673] Limit search for used categories and item types to current branch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #7 from Lucas Gass <lucas@bywatersolutions.com> --- Missing 23.05.x dependencies, no backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|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=36447 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36447 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40205 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40205 [Bug 40205] "Default checkout, hold and return policy" cannot be unset -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org