]> git.koha-community.org Git - koha.git/commit
Bug 26587: Cache libraries in Koha/Template/Plugins/Branches.pm to improve performance
authorBjörn Nylén <bjorn.nylen@ub.lu.se>
Mon, 3 May 2021 11:13:25 +0000 (13:13 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 22 Dec 2021 06:37:39 +0000 (20:37 -1000)
commit0b31eef144b1eba64d84127281830ffb78e5c3ae
treefd1906fb14e0dc8be753d4900d557b7e652eaa74
parent7bfba3740b92f132365bb4046c84892455dd1ba8
Bug 26587: Cache libraries in Koha/Template/Plugins/Branches.pm to improve performance

This patch caches the Koha::Library object in a hashmap in the Branches object (GetName, GetURL)
to avoid multiple database lookups while looping many items.

To test:
1. Have a biblio with many items (1000's).
2. View in staff (detail.pl) and opac (opac-detail.pl). Note how long it takes to load.
3. Apply patch.
4. Repeat 2. Note that pages load faster.

Sponsored-by: Lund University Library
JK: replaced tab indendation with spaces
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Template/Plugin/Branches.pm