[Bug 30232] New: Acquisition logged in user performance
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Bug ID: 30232 Summary: Acquisition logged in user performance Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org Some acquisition methods can take borrowernumber or a Koha::Patron->unblessed. When called with logged in user, sometimes in a loop, performance will be better if fetching Koha::Patron of logged in user only once. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |fridolin.somers@biblibre.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 131391 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131391&action=edit Bug 30232: Logged in user performance for CanUserManageBasket() Some acquisition methods can take borrowernumber or a Koha::Patron->unblessed. When called with logged in user, sometimes in a loop, performance will be better if fetching Koha::Patron of logged in user only once. This patch optimises call for CanUserManageBasket(). You may benchmark on a vendor with a lot of baskets. Test plan 1) 1.1) Log in to staff interface as user A with all acquisition permissions 1.2) Set system preference 'AcqViewBaskets' to 'created or managed by staff member' 1.3) Create a new basket 1.4) Copy URL, ie /cgi-bin/koha/acqui/basket.pl?basketno=2 1.5) Click on 'Baskets' tab, you see the basket in table 2) 2.1) Log in to staff interface as user B with acquisition permissions but not 'order_manage_all' 2.2) Go to URL => You don't have access to basket 2.3) Click on 'Baskets' tab => you don't see the basket in table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131391|0 |1 is obsolete| | --- Comment #2 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 131392 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131392&action=edit Bug 30232: Logged in user performance for CanUserManageBasket() Some acquisition methods can take borrowernumber or a Koha::Patron->unblessed. When called with logged in user, sometimes in a loop, performance will be better if fetching Koha::Patron of logged in user only once. This patch optimises call for CanUserManageBasket(). Also removes a useless refetch of logged in patron. You may benchmark on a vendor with a lot of baskets. Test plan 1) 1.1) Log in to staff interface as user A with all acquisition permissions 1.2) Set system preference 'AcqViewBaskets' to 'created or managed by staff member' 1.3) Create a new basket 1.4) Copy URL, ie /cgi-bin/koha/acqui/basket.pl?basketno=2 1.5) Click on 'Baskets' tab, you see the basket in table 2) 2.1) Log in to staff interface as user B with acquisition permissions but not 'order_manage_all' 2.2) Go to URL => You don't have access to basket 2.3) Click on 'Baskets' tab => you don't see the basket in table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 --- Comment #3 from Fridolin Somers <fridolin.somers@biblibre.com> --- Patch "Logged in user performance for CanUserManageBasket()" Page /cgi-bin/koha/acqui/booksellers.pl tested with 3000 baskets. Time goes from 30s to 20s. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 --- Comment #4 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 131393 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131393&action=edit Bug 30232: Logged in user performance for CanUserUseBudget() Some acquisition methods can take borrowernumber or a Koha::Patron->unblessed. When called with logged in user, sometimes in a loop, performance will be better if fetching Koha::Patron of logged in user only once. This patch optimises call for CanUserUseBudget(); You may benchmark on a user with a lot of budgets acess. Test plan : Play with impacted pages and check budgets list is the same than wihtout patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131392|0 |1 is obsolete| | --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 131395 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131395&action=edit Bug 30232: Logged in user performance for CanUserManageBasket() Some acquisition methods can take borrowernumber or a Koha::Patron->unblessed. When called with logged in user, sometimes in a loop, performance will be better if fetching Koha::Patron of logged in user only once. This patch optimises call for CanUserManageBasket(). Also removes a useless refetch of logged in patron. You may benchmark on a vendor with a lot of baskets. Test plan 1) 1.1) Log in to staff interface as user A with all acquisition permissions 1.2) Set system preference 'AcqViewBaskets' to 'created or managed by staff member' 1.3) Create a new basket 1.4) Copy URL, ie /cgi-bin/koha/acqui/basket.pl?basketno=2 1.5) Click on 'Baskets' tab, you see the basket in table 2) 2.1) Log in to staff interface as user B with acquisition permissions but not 'order_manage_all' 2.2) Go to URL => You don't have access to basket 2.3) Click on 'Baskets' tab => you don't see the basket in table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 131396 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131396&action=edit Bug 30232: Logged in user performance for CanUserUseBudget() and CanUserModifyBudget() Some acquisition methods can take borrowernumber or a Koha::Patron->unblessed. When called with logged in user, sometimes in a loop, performance will be better if fetching Koha::Patron of logged in user only once. This patch optimises call for CanUserUseBudget() and CanUserModifyBudget(); You may benchmark on a user with a lot of budgets acess. Test plan : Play with impacted pages and check budgets list is the same than wihtout patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131395|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131393|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131395|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- /cgi-bin/koha/acqui/acqui-home.pl with 300 funds :
From 13 seconds to 10 seconds
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |7923 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7923 [Bug 7923] Performance omnibus -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joonas.kylmala@iki.fi Status|Needs Signoff |Failed QA --- Comment #8 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- I think it would be better if you change those C4/Budgets.pm functions accept directly a Koha::Patron, reading the code there is now a lot of duplication regarding the unblessing of the patron. Haven't checked all cases but if you check the code for CanUserUseBudget it's perfectly fine to just use the Koha::Patron methods, just remove the curly braces from the current code basically to make it work. I'd like to mark this as FQA if you don't mind. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|Failed QA |RESOLVED --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Indeed the idea was not that good. I close invalid
it would be better if you change those C4/Budgets.pm functions accept directly a Koha::Patron This will be for another bug report
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30232 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36155 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org