[Koha-bugs] [Bug 28172] Optimize Koha::Plugins::GetPlugins

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 20 09:16:07 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28172

--- Comment #2 from Julian Maurice <julian.maurice at 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.


More information about the Koha-bugs mailing list