MDL-39445 get_plugin_list clean_param use is slow

get_plugin_list was calling clean_param($pluginname, PARAM_PLUGIN) a
lot (600+ times per page), and that is much slower than you would guess.
A specific function for this case, (which we then also use from
clean_param) is a performance win.
This commit is contained in:
Tim Hunt 2013-05-01 11:35:14 +01:00
parent 95190fda69
commit 5f85073525
3 changed files with 28 additions and 9 deletions

View file

@ -192,8 +192,7 @@ class cache_helper {
if (in_array($pluginname, $ignored)) {
continue;
}
$pluginname = clean_param($pluginname, PARAM_PLUGIN);
if (empty($pluginname)) {
if (!is_valid_plugin_name($pluginname)) {
// Better ignore plugins with problematic names here.
continue;
}