-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
2.1
-
MOODLE_21_STABLE
-
MDL-28214_perfomance_settings
-
There is some unnecessarily complicated logic in renderer_base::footer
if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {
|
$perf = get_performance_info();
|
if (defined('MDL_PERFTOLOG') && !function_exists('register_shutdown_function')) {
|
error_log("PERF: " . $perf['txt']);
|
}
|
if (defined('MDL_PERFTOFOOT') || debugging() || $CFG->perfdebug > 7) {
|
$performanceinfo = $perf['html'];
|
}
|
}
|
The logic here means that often $CFG->perfdebug is ignored, and the information is displayed anyway.
I think this Should be changed to a set of two check-boxes:
Track performance info: [] Display in the footer [] Write to the log file.
The description of this setting should then have a reminder to developers that it is better to set $CFG->perfinfo in config.php, so that performance in counted right from the start of the request, rather than starting when $CFG is initialised.
Once $CFG->perfinfo is fixed to work properly, we should then be able to eliminate all the MDL_PERF constants.