Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.6, 2.7, 2.8, 2.9
-
MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
-
MOODLE_29_STABLE
-
Description
Following on from the changes in MDL-40585, where a cache has been added to the get_parent_path function, I found from profiling that a significant time in restore is still spent on grouped_parser_processor::parent_exists.
Adding a cache directly to this function (in addition to the existing get_parent_path cache) appears to improve performance on a large test course by about one sixth with about a 2MB memory cost.
I did two runs before/after my code patch (alternating) using the 'M' size standard test course, with profiling turned off again. Results:
Before: 359.5s (forgot to note memory use)
After: 308.4s (85.6 MB)
Before: 373.7s (83.4MB)
After: 297.7s (85.6MB)
Average is a 17% improvement.
This needs review as maybe I'm missing something silly.
If successful, it may be possible to backport this change to 2.4 and 2.5.