[Bug 21015] New: Members.pm slow because it loads twice Koha::Schema
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Bug ID: 21015 Summary: Members.pm slow because it loads twice Koha::Schema Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: j.kylmala@gmail.com QA Contact: testopia@bugs.koha-community.org Koha/C4/Members.pm currently loads by itself Koha::Schema using "use Koha::Schema" even though this is not required as we could use Koha::Database that has already done that (another further issue is why does Koha::Database load all the classes in Koha/Schema/Result/ when it could just load the ones that are needed). Loading the Koha::Schema takes for me around 2 seconds on my machine so it would be quite a big performance boost to remove it. I got a 30% faster load time on cgi-bin/koha/members/moremember.pl with a patch I made. I will attach it here but be warned: I have not run any tests and I don't know if it has even syntax errors because I'm doing the patch on a machine without a proper development environment. -- 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=21015 j.kylmala@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |j.kylmala@gmail.com |ity.org | --- Comment #1 from j.kylmala@gmail.com --- Created attachment 76556 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76556&action=edit Bug 21015: fix performance issue with C4::Members This is the proposed patch but please run the tests as I have not done so (yet). -- 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=21015 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi, this is already looking good. Could you still add a little test plan to see where the routine is used for the testers? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** Bug 21160 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76556|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80751 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80751&action=edit Bug 21015: fix performance issue with C4::Members loading Koha::Schema ("use Koha::Schema;") takes significantly time as it loads almost a couple hundred classes. Koha::Database has done that already once and we can use it to get the ResultSet "Borrower" as well, so let's use that. This also make the code more unified because Koha::Database is used throughout the code instead of Koha::Schema. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 80752 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80752&action=edit Bug 21015: Remove unecessary 'use Koha::Schema' statements in t/ Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- ho, excellent! % more t.pl use C4::Members; print get_cardnumber_length(); Without the patch: ~1.6s With the patch: 0.8s -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- Awesome! I should've looked more thoroughly when I reported #21160. This should have some nice knock on effects, especially for CGI users. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80751|0 |1 is obsolete| | --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 81865 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81865&action=edit Bug 21015: fix performance issue with C4::Members loading Koha::Schema ("use Koha::Schema;") takes significantly time as it loads almost a couple hundred classes. Koha::Database has done that already once and we can use it to get the ResultSet "Borrower" as well, so let's use that. This also make the code more unified because Koha::Database is used throughout the code instead of Koha::Schema. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80752|0 |1 is obsolete| | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 81866 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81866&action=edit Bug 21015: Remove unecessary 'use Koha::Schema' statements in t/ Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #10 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Pushed to Master |Pushed to Stable --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.05.x for 18.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21015 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED CC| |fridolin.somers@biblibre.co | |m --- Comment #12 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.11.x for 17.11.13 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org