[Bug 34121] New: Improve performance of Koha::Plugins::call
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34121 Bug ID: 34121 Summary: Improve performance of Koha::Plugins::call Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Koha::Plugins::call() uses get_enabled_plugins to get all enabled plugins, including plugins that do not have the method to be called. In addition, get_enabled_plugins uses can_load to evaluate plugis, but call already uses eval to call methods making the use of can_load and $plugin_class->new() superfluous and wasteful. We should filter out all enabled plugins that do not match the plugin method being called and allow the eval in call() to handle plugin error handling. -- 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=34121 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- 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=34121 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 152699 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152699&action=edit Bug 34121: Filter enabled plugins for the given method -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34121 --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 152700 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152700&action=edit Bug 34121: Do not test plugin ahead of time -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34121 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=33972 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34121 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- Hi Kyle, As it is in master, Koha::Plugins::call runs one SQL query on the first invocation, and zero on the next invocations (thanks to Koha::Cache::Memory::Lite). With your patches, it will run 2 SQL queries on every invocations. Is it really faster ? (In reply to Kyle M Hall from comment #0)
In addition, get_enabled_plugins uses can_load to evaluate plugis, but call already uses eval to call methods making the use of can_load and $plugin_class->new() superfluous and wasteful.
That's two different things. `get_enabled_plugins` instantiates each plugin object, while `call` uses these plugin object to invoke the plugin method. You can't invoke the plugin method without instantiating the plugin object first I can see that the patches are not finished yet, but wanted to give you an early feedback anyway. I hope that helps -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34121 --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> ---
I can see that the patches are not finished yet, but wanted to give you an early feedback anyway. I hope that helps
Thanks for the feedback. I'm presuming that can_load is heavier than a query. I should test my assumptions. I also should implement caching per-method. I'm also leaning toward the the second patch being a bad idea. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org