[Koha-bugs] [Bug 11112] Koha::Calendar->new loads all holidays
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Nov 19 06:53:29 CET 2013
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11112
Brendan Gallagher <brendan at bywatersolutions.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #22427|0 |1
is obsolete| |
--- Comment #4 from Brendan Gallagher <brendan at bywatersolutions.com> ---
Created attachment 23017
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23017&action=edit
[PASSED-QA] Bug 11112: Koha::Calendar needs some caching
holidays is built each time a Koha::Calendar object is created.
The Koha::Calendar's builder retrieves all holidays from the database
and create a DateTime::Set object with all holidays.
In one of our customer's DB, there are 11085 special_holidays and 598
repeatable_holidays.
On a return, there are 3 calls to Koha::Calendar->new.
Nytprof benchmarks (on a 3.8.x branch):
In DateTime::Set->from_datetimes:
3 times (5.49ms+4.90s) by Koha::Calendar::_init at line 80 of Koha/Calendar.pm,
avg 1.63s/call
on a total of 7.67s (of 10.2s), executing 6353333 statements and 3031273
subroutine calls in 147 source files and 36 string evals.
for the circulation/return.pl page.
Comparing the access_log:
Without the patch:
checkout: time=2759838
checkin: time=1832751
Without the patch and with overdues:
checkout: time=1086727 + time=1144706
checkin: time=3928854 (x2)
With the patch and overdues:
checkout: time=1077839 + time=1060886
checkin: time=2420898
Test plan:
- checkout an item with a return date < today
- checkin the item and verify the suspension period is well calculated
(depending on the holidays).
- prove t/db_dependent/Holidays.t
- t/Calendar.t
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan at bywatersolutions.com>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list