stable

Clone or download

Read-only

request #11796 Too many SQL calls on "plugin" table done at each hit

When profiling a simple page like the new git repositories listing, ~50 of the queries (19 on 40) are related to the plugin table (to know the name of one specific plugin or to know if a plugin is restricted or not). It's more efficient to make a single call for all plugins and to inject the informations when it's instanciated. As plugin table is small and probably utterly cached by mysql, the gain is almost null in the whole process but that's still reduce mysql pressure. Change-Id: I5b9292e7809680834f0844bfba9632f204fbd563

Modified Files

Name
M src/common/autoload.php +3 −5 Go to diff View file
M src/common/dao/PluginDao.class.php +7 −2 Go to diff View file
M src/common/plugin/Plugin.class.php +23 −2 Go to diff View file
M src/common/plugin/PluginFactory.class.php +6 −0 Go to diff View file
M src/common/plugin/PluginManager.class.php +13 −2 Go to diff View file
M src/common/plugin/PluginProxy.php +29 −2 Go to diff View file
A src/common/plugin/PluginProxyInjectedData.php +50 −0 Go to diff View file
M tests/php7compatibletests.list +0 −1 Go to diff View file
A tests/phpunit/common/Plugin/PluginProxyTest.php +111 −0 Go to diff View file
A tests/phpunit/common/Plugin/PluginTest.php +91 −0 Go to diff View file
A tests/phpunit/common/Plugin/_fixtures/DatPlugin.php +66 −0 Go to diff View file
M tests/simpletest/common/plugin/PluginManagerTest.php +4 −1 Go to diff View file
D tests/simpletest/common/plugin/PluginProxyTest.php +0 −77 Go to diff View file