-
Improvement
-
Resolution: Fixed
-
Minor
-
2.4.3
-
MOODLE_24_STABLE
-
MOODLE_26_STABLE
-
w33_
MDL-39474_m26_debugdeveloper -
-
BACKEND Sprint 4
There are two points in very frequently-used code (in the MUC cache::hash_key function, and the get_string function) where additional checks are carried out if developer debug mode is turned on.
This is good practice but the debugging() function to check this is quite expensive.
I propose replacing this pattern with a new global variable. This reduces the cost of checking for developer debug to the absolute minimum. (Remember, we are only 'checking if we can waste time doing extra checks' so it shouldn't take a long time to do that check, especially if it's useful in functions that may be called thousands of times in a request!)
I've done extensive profiling of three options and believe the global variable is the best option. I'll add this in a comment.
- Discovered while testing
-
MDL-41384 Debugging message regarding numsections in course format when upgrading
- Closed
- has a non-specific relationship to
-
CONTRIB-5566 Verify some deprecated debugging uses
- Closed