-
Bug
-
Resolution: Fixed
-
Minor
-
2.4.6, 2.5.2, 2.6
-
MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
MDL-41728-master -
The add_task function in base_plan contains logic in a loop that does in_array on the list of settings. For very large courses, there may be thousands of settings, so this is a low-performance call.
The setting list is already indexed by name. We can refactor the code to use the name index instead. By adding comments as well, the code will become clearer as well as slightly faster.
Performance improvement on backup 'initial settings' screen:
XL test course (measured using profiler):
129.0 -> 110.5 seconds.
14% execution time, 23% CPU time.
L test course (no profiler, measured using perf info block, after 1 request to prime caches, 2 runs):
15.1 -> 14.7 seconds
15.3 -> 14.7 seconds
3% execution time (average)
Conclusion: This change has a small impact (half a second, 3%) on large courses, but becomes significant with very large courses where time is critical.
- will help resolve
-
MDL-41722 Backup: Very large course times out on user interface pages
-
- Closed
-