Bug 13214 - Improve performance of acqui/addorderiso2709.pl, stop fetching all import_records needlessly
Summary: Improve performance of acqui/addorderiso2709.pl, stop fetching all import_rec...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Olli-Antti Kivilahti
QA Contact: Testopia
URL:
Keywords:
Depends on: 7180
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-06 14:44 UTC by Olli-Antti Kivilahti
Modified: 2016-06-21 21:37 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 13214 - Improve performance of acqui/addorderiso2709.pl, stop fetching all import_records needlessly (1.48 KB, patch)
2014-11-06 14:48 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 13214 - Improve performance of acqui/addorderiso2709.pl, stop fetching all import_records needlessly (1.54 KB, patch)
2014-11-06 16:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 13214 - Improve performance of acqui/addorderiso2709.pl, stop fetching all import_records needlessly (1.61 KB, patch)
2014-11-21 16:06 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Olli-Antti Kivilahti 2014-11-06 14:44:50 UTC
When you have 167 import batches and you try to pick one by going to acqui/addorderiso2709.pl, it takes ~16s to load the page.

This is because all import_records are loaded simply to check if an import_batch has recors with the given status.

This patch fixes this and cuts the load time to 1.6s
Comment 1 Olli-Antti Kivilahti 2014-11-06 14:48:41 UTC Comment hidden (obsolete)
Comment 2 Olli-Antti Kivilahti 2014-11-06 14:49:38 UTC
Tested using Jonathan's excellent tutorial about Perl performace profiling!

http://wiki.koha-community.org/wiki/Profiling_with_Devel::NYTProf
Comment 3 Jonathan Druart 2014-11-06 16:04:05 UTC
(In reply to Olli-Antti Kivilahti from comment #2)
> Tested using Jonathan's excellent tutorial about Perl performace profiling!
> 
> http://wiki.koha-community.org/wiki/Profiling_with_Devel::NYTProf

It's not mine :)
Comment 4 Jonathan Druart 2014-11-06 16:08:32 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall (khall) 2014-11-21 16:06:19 UTC
Created attachment 33794 [details] [review]
[PASSED QA] Bug 13214 - Improve performance of acqui/addorderiso2709.pl, stop fetching all import_records needlessly

TEST PLAN:

1. Load 167 staged files to Koha.
2. Try to make an acquisiton from a staged file.
3. Wait 16s for the acqui/addorderiso2709.pl -view to load.

AFTER PATCH:

1. Load 167 staged files to Koha.
2. Try to make an acquisiton from a staged file.
3. Wait 1.6s for the acqui/addorderiso2709.pl -view to load.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Tomás Cohen Arazi (tcohen) 2014-12-01 13:02:30 UTC
Patch pushed to master.

Thanks Olli!