[Koha-bugs] [Bug 19884] New: Improve performance of GetItem

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Dec 27 15:47:12 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19884

            Bug ID: 19884
           Summary: Improve performance of GetItem
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: glasklas at gmail.com
        QA Contact: testopia at bugs.koha-community.org

While benchmarking Koha trying to improve indexing speed
DBIx::Class::ResultSet->find() in C4::Koha::Getitem stood out as a major
bottleneck. I looked through the code, and it's only when 'item-level_itypes'
is enabled when the actual item object is needed, if not the function can be
optimized by only fetching the the data through the much faster low-level DBI
interface. This is of course a bit of a kludge, and I would normally avoid this
type of micro-optimization, but with this fix we managed to shave a couple of
hours of a full re-indexing, and get it done during closing hours. I have also
added some more tests to try to catch any possible future issues this change
might cause. If more stuff needs to be fetched through the Item-object there
could be issues, but this should be clearly pointed out in the code. I also
removed an extra call to GetItem() in GetMarcItem() by making it accept an item
object or item id as argument, and only fetch the item if needed, cutting the
actual calls to GetItem by about half.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list