Bug 19023 - inventory tool performance
Summary: inventory tool performance
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Fridolin SOMERS
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 14399 17249 17819
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-02 09:12 UTC by Fridolin SOMERS
Modified: 2017-09-20 01:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19023 - inventory tool performance (3.30 KB, patch)
2017-08-02 09:26 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 19023 - inventory tool performance (3.36 KB, patch)
2017-08-02 14:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 19023 - inventory tool performance (3.40 KB, patch)
2017-08-02 17:43 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2017-08-02 09:12:17 UTC
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.
Comment 1 Fridolin SOMERS 2017-08-02 09:26:33 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2017-08-02 14:13:08 UTC
Created attachment 65426 [details] [review]
[SIGNED-OFF] 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>
Comment 3 Kyle M Hall 2017-08-02 17:43:03 UTC
Created attachment 65435 [details] [review]
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>
Comment 4 Jonathan Druart 2017-08-09 19:54:25 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 5 Fridolin SOMERS 2017-09-12 15:10:49 UTC
Pushed to 17.05.x, will be in 17.05.04.
Comment 6 Katrin Fischer 2017-09-16 06:55:11 UTC
This patch has been pushed to 16.11.x and will be in 16.11.12.
Comment 7 Mason James 2017-09-20 01:42:29 UTC
Blocked by bug 14399, skipping for 16.05.x