[Koha-bugs] [Bug 36447] New: Circ rules slow to load when many itemtypes and categories

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 27 21:41:13 CET 2024


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 at lists.koha-community.org
          Reporter: nick at bywatersolutions.com
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at 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.


More information about the Koha-bugs mailing list