Bug 13852 - Manage C4::VirtualShelves in C4::Auth for performance
Summary: Manage C4::VirtualShelves in C4::Auth for performance
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 7923 13998
  Show dependency treegraph
 
Reported: 2015-03-17 13:49 UTC by Fridolin Somers
Modified: 2015-12-03 22:11 UTC (History)
2 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 13852 - Manage C4::VirtualShelves in C4::Auth for performance (3.82 KB, patch)
2015-03-17 14:24 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 13852 - Manage C4::VirtualShelves in C4::Auth for performance (3.92 KB, patch)
2015-03-19 10:19 UTC, Marcel de Rooy
Details | Diff | Splinter Review
[PASSED QA] Bug 13852 - Manage C4::VirtualShelves in C4::Auth for performance (3.94 KB, patch)
2015-03-27 13:01 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 2015-03-17 13:49:08 UTC
In C4::Auth there is a use C4::VirtualShelves.
Virtualshelves are displayed in all OPAC pages, but not in intranet.
For performance, we should move this into a require only for opac pages.
Comment 1 Fridolin Somers 2015-03-17 14:24:18 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2015-03-19 10:19:16 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2015-03-27 13:01:46 UTC
Created attachment 37315 [details] [review]
[PASSED QA] Bug 13852 - Manage C4::VirtualShelves in C4::Auth for performance

In C4::Auth there is a use C4::VirtualShelves.
Virtualshelves are displayed in all OPAC pages, but not in intranet.
For performance, we should move this into a require only for opac pages.

This patch adds a condition to fetch virtualshelves only if opac and moves the dependancy on C4::VirtualShelves into require calls.

On my desktop, I have those compilation times for C4/Auth.pm :
- Without patch : 0,41 seconds
- With patch : 0,22 seconds

This performance improvement is very usefull for pages that only use a few as dependancy, like errors/404.pl

Test plan :
- Be sure there are some public lists
- Apply patch
- Go to opac (not logged-in)
- Click on "Lists"
- Check you see the public lists
- Login with a user
- Be sure this user has some private lists
- Click on "Lists"
- Check you see the public and private lists
- Logout
- Go to /cgi-bin/koha/opac-reserve.pl
- You see the loggin page
- Click on "Lists"
- Check you see the public lists
- Go to intranet
- Check you can loggin

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Tomás Cohen Arazi 2015-03-31 17:19:53 UTC
Patch pushed to master.

Thanks (for the Pastis) Frido!
Comment 5 Jonathan Druart 2015-04-15 11:24:33 UTC
Ok, found you!
This is crazy but... this patch breaks opac-ratings-ajax.pl, see bug 13998