Summary: | Circ rules slow to load when many itemtypes and categories | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Staff interface | Assignee: | Kyle M Hall (khall) <kyle> |
Status: | RESOLVED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | major | ||
Priority: | P5 - low | CC: | evelyn, fridolin.somers, gmcharlt, jonathan.druart, kyle.m.hall, kyle, lucas, m.de.rooy, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
24.05.00,23.11.05
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 36673 | ||
Attachments: |
Bug 36447: Circ rules slow to load when many itemtypes and categories
Bug 36447: Circ rules slow to load when many itemtypes and categories Bug 36447: Circ rules slow to load when many itemtypes and categories |
Description
Nick Clemens (kidclamp)
2024-03-27 20:41:13 UTC
Created attachment 164065 [details] [review] 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! Created attachment 164083 [details] [review] 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> Created attachment 164121 [details] [review] 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> Pushed for 24.05! Well done everyone, thank you! Would it be possible to backport this for 23.11? Pushed to 23.11.x for 23.11.05 Missing 23.05.x dependencies, no backport. |