Bug 19023 - inventory tool performance
commit4c76583e6d3079bad51048f62f43c3c433f1e9bd
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 2 Aug 2017 09:21:58 +0000 (2 11:21 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 12 Sep 2017 15:09:51 +0000 (12 17:09 +0200)
tree470cb224f5ce0e545bcb96ca322dd51be0a65828
parent960015819e0c19ef85c458d0bdaec8a24cd86dc3
Bug 19023 - inventory tool performance

Inventory tool performance seems to be worst since 16.11.
I think it is because of authorized values computing changed by Bug 17249.

For each subfield of each item, we try to get the authorized value description with Koha::AuthorisedValues->search_by_marc_field.
But this method does not use cache like Koha::AuthorisedValues->get_description_by_koha_field.

I propose to use Koha::AuthorisedValues->get_description_by_koha_field and also to look for authorized value description only for item fields used in TT : location, notforloan, itemlost, damaged, withdrawn.

I have experimented inventory time on 100 items from 5s to 1s.

Test plan :
- Without patch
- Perform inventory with barcode file
- Check results and mesure execution time
- Apply patch
- Reperform inventory with same barcode file
- Check results is the same
- Compare execution time
- Run prove t/db_dependent/Items/GetItemsForInventory.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 95f1844e6c46ff51de9f95f99fcdf3369c756fd4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
tools/inventory.pl