Summary: | Improve performance of Koha::Plugins::call | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall (khall) <kyle> |
Component: | Plugin architecture | Assignee: | Kyle M Hall (khall) <kyle> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | julian.maurice |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33972 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 34121: Filter enabled plugins for the given method
Bug 34121: Do not test plugin ahead of time |
Description
Kyle M Hall (khall)
2023-06-26 15:46:32 UTC
Created attachment 152699 [details] [review] Bug 34121: Filter enabled plugins for the given method Created attachment 152700 [details] [review] Bug 34121: Do not test plugin ahead of time 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 > 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.
|