[Koha-bugs] [Bug 32476] Add caching for relatively expensive patron methods

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Oct 17 15:10:42 CEST 2023


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

--- Comment #35 from David Gustafsson <glasklas at gmail.com> ---
(In reply to Kyle M Hall from comment #28)
> I really like this conceptually. The suggestion I would make is to reverse
> the use of the cache param. Only require "cache => 0" to not use the cache.
> You already have cache invalidation to the only time it's needed is in
> _accessor_cache

This could be done, and it would probably work, but I opted for conservatism as
there is in practical terms no benefit in terms of performance using cache for
the methods in places where they are called just a few times, and a non zero
chance of introducing some subtle cache related bug. While not 100% I'm pretty
sure I caught all the performance critical cases, and if we find any more it's
simple to just cache them as well. I think the current solution is perhaps a
little bit too over engineered for just caching these two methods in a few
places, but perhaps also does not hurt to have a more standardized way of
implementing per instance caching if more performance critical methods are
added ore discovered in the future.

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


More information about the Koha-bugs mailing list