[Bug 28172] New: Optimize Koha::Plugins::GetPlugins
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 Bug ID: 28172 Summary: Optimize Koha::Plugins::GetPlugins Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@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=28172 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 119870 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119870&action=edit Bug 28172: [DO NOT PUSH] Test script for GetPlugins -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 119871 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119871&action=edit Bug 28172: Optimize Koha::Plugins::GetPlugins Instead of doing one SQL query for retrieving a list of plugin classes (filtered or not by a method name) + one SQL query for each loaded plugin (to look up the 'enabled' status), we can do a single SQL query, fetching only enabled plugins, and do the method check using `can`. It allows to use the Module::Load::Conditional cache when requesting only enabled modules, which gives a great performance boost Also, call get_metadata only if needed Test plan: 1. Make sure you have some plugins enabled 2. Apply the 1st patch ("Test script for GetPlugins") 3. Run the test script several times, copy each result into a file A 4. Apply the other patch(es) 5. Run the test script several times, copy each result into another file B 6. Compare the results. Times in file B should be smaller than in file A -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Without the patch: % ./test_getplugins.pl 2 plugins detected, 2 enabled First 2 calls to GetPlugins: 0.533s 1000 calls to GetPlugins: 3.505s 1000 calls to GetPlugins with method = "unknown_method": 0.824s 1000 calls to GetPlugins with all = 1: 3.580s With the patch: % ./test_getplugins.pl 2 plugins detected, 2 enabled First 2 calls to GetPlugins: 0.535s 1000 calls to GetPlugins: 1.502s 1000 calls to GetPlugins with method = "unknown_method": 0.730s 1000 calls to GetPlugins with all = 1: 3.795s -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29672 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |7923 CC| |fridolin.somers@biblibre.co | |m 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=28172 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Patch doesn't apply --- Comment #4 from David Nind <david@davidnind.com> --- The patch no longer applies :-(.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- Arf not a trivial rebase. I leave it to Julian ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119870|0 |1 is obsolete| | --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 142917 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=142917&action=edit Bug 28172: [DO NOT PUSH] Test script for GetPlugins -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #119871|0 |1 is obsolete| | --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 142918 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=142918&action=edit Bug 28172: Optimize Koha::Plugins::GetPlugins Instead of doing one SQL query for retrieving a list of plugin classes (filtered or not by a method name) + one SQL query for each loaded plugin (to look up the 'enabled' status), we can do a single SQL query, fetching only enabled plugins, and do the method check using `can`. It allows to use the Module::Load::Conditional cache when requesting only enabled modules, which gives a great performance boost Also, call get_metadata only if needed Test plan: 1. Make sure you have some plugins enabled 2. Apply the 1st patch ("Test script for GetPlugins") 3. Run the test script several times, copy each result into a file A 4. Apply the other patch(es) 5. Run the test script several times, copy each result into another file B 6. Compare the results. Times in file B should be smaller than in file A -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- Rebased on master, but now when running the test script I get a really bad time for "1000 calls to GetPlugins with all = 1". As bug 29672 changes Koha::Plugins::call so that it does not use GetPlugins, I'm not sure if this patch is still relevant. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Julian Maurice from comment #8)
Rebased on master, but now when running the test script I get a really bad time for "1000 calls to GetPlugins with all = 1".
As bug 29672 changes Koha::Plugins::call so that it does not use GetPlugins, I'm not sure if this patch is still relevant.
Hi Julian, should we close this now that bug 29672 is pushed? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs Signoff |RESOLVED --- Comment #10 from David Nind <david@davidnind.com> --- Changed status - fixed on bug 29672. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org