Optimize file annotation in backup process for significant speed improvement #588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Info
We are excited to present this one-liner patch that significantly improves the runtime (up to 100x faster). Our team has conducted extensive research and testing as part of a client project. We hope this enhancement helps you with the previously slow backups in your Moodle installations. If you have any questions, you can reach us through our website: Sudile GbR.
The exact impacts of this change are described below.
Solution
https://github.com/h5p/moodle-mod_hvp/blob/stable/backup/moodle2/backup_hvp_stepslib.php#L243
The line at this location needs to be:
Explanation
All the library files exist in the context system and therefore have no context difference. If added to the child element
$library, Moodle tries to add all module files into the library node. This leads to a situation where, for each library, all the files are being loaded. Only at the very end does Moodle resolve the issue by saving the files in the archive, which only allows unique files by hash.Related issues
#423 #262 #253 #423 #561
Vincent Schneider (vincent.schneider@sudile.com)