Bug 16734 - getLanguages() in opac-search.pl should be called only if needed
Summary: getLanguages() in opac-search.pl should be called only if needed
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jacek Ablewicz
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 15262
  Show dependency treegraph
 
Reported: 2016-06-14 14:31 UTC by Jacek Ablewicz
Modified: 2017-12-07 22:18 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:


Attachments
Bug 16734: getLanguages() in opac-search.pl should be called only if needed (2.25 KB, patch)
2016-06-14 14:37 UTC, Jacek Ablewicz
Details | Diff | Splinter Review
Bug 16734: getLanguages() in opac-search.pl should be called only if needed (2.38 KB, patch)
2016-06-14 15:46 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16734: getLanguages() in opac-search.pl should be called only if needed (2.45 KB, patch)
2016-06-14 16:03 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Ablewicz 2016-06-14 14:31:49 UTC
There is no need to always call getLanguages() in opac/opac-search.pl (especially not if it's an actual search), it's output is used only in opac-advsearch.tt template. This patch moves it into 'if ( ... $template_type eq 'advsearch' )' block.

Speed gain is rather moderate (40 - 80 msec, if the mysql server is no too busy, and the results are already in query cache), but it eliminates a lot of small DBI calls, making a further profiling of OPAC searches a bit easier.
Comment 1 Jacek Ablewicz 2016-06-14 14:37:56 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2016-06-14 15:46:27 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-06-14 16:03:58 UTC
Created attachment 52397 [details] [review]
Bug 16734: getLanguages() in opac-search.pl should be called only if needed

There is no need to always call getLanguages() in opac/opac-search.pl
(especially not if it's an actual search), it's output is used only
in opac-advsearch.tt template. This patch moves it into
'if ( ... $template_type eq 'advsearch' )' block.

Speed gain is rather moderate (40 - 80 msec, if the mysql server
is no too busy, and the results are already in query cache),
but it eliminates a lot of small DBI calls, making a further
profiling of OPAC searches a bit easier.

Test plan: just ensure that language selection is still available
on OPAC advanced search page, and that it still works like intended.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Kyle M Hall 2016-06-17 14:39:45 UTC
Pushed to master for Koha 16.11, thanks Jacek!