Revision performance improvements #10589
Merged
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.
Description
Builds on the changes in #10577, but for revision creation.
When a revision is being created, if it contains any Matrix blocks, those blocks are no longer directly duplicated for the revision. Instead, we create revisions for each of the Matrix blocks, which are assigned to the owner’s revision.
Revision creation still duplicates the element under the hood, so the initial revision creation isn’t much different from the normal block duplication we’ve done previously. However, revisions are only ever created for elements that have been edited since the last time a revision was created. So in effect, Matrix blocks will only ever be duplicated for an owner’s new revision if they have actually been edited.
Here’s a look at the performance gains when saving an entry with 100 blocks and 10 sites:
Related issues