Summary: | Members.pm slow because it loads twice Koha::Schema | ||
---|---|---|---|
Product: | Koha | Reporter: | Joonas Kylmälä <joonas.kylmala> |
Component: | Database | Assignee: | Joonas Kylmälä <joonas.kylmala> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | minor | ||
Priority: | P5 - low | CC: | dcook, fridolin.somers, jonathan.druart, m.de.rooy, martin.renvoize, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 21015: fix performance issue with C4::Members
Bug 21015: fix performance issue with C4::Members Bug 21015: Remove unecessary 'use Koha::Schema' statements in t/ Bug 21015: fix performance issue with C4::Members Bug 21015: Remove unecessary 'use Koha::Schema' statements in t/ |
Description
Joonas Kylmälä
2018-06-29 08:11:02 UTC
Created attachment 76556 [details] [review] 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). Hi, this is already looking good. Could you still add a little test plan to see where the routine is used for the testers? *** Bug 21160 has been marked as a duplicate of this bug. *** Created attachment 80751 [details] [review] 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> Created attachment 80752 [details] [review] Bug 21015: Remove unecessary 'use Koha::Schema' statements in t/ Signed-off-by: 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 Awesome! I should've looked more thoroughly when I reported #21160. This should have some nice knock on effects, especially for CGI users. Created attachment 81865 [details] [review] 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> Created attachment 81866 [details] [review] 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> Awesome work all! Pushed to master for 18.11 Pushed to 18.05.x for 18.05.06 Pushed to 17.11.x for 17.11.13 |