Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Matrix block ownership #10577

Merged
merged 5 commits into from
Feb 16, 2022

Conversation

brandonkelly
Copy link
Member

@brandonkelly brandonkelly commented Feb 16, 2022

Description

This PR introduces the ability for a Matrix block to have multiple owners, via a new matrixblocks_owners join table. This enables a massive performance improvement when creating new drafts: we no longer need to duplicate Matrix blocks for drafts, unless something has actually changed within the block. Instead we can just duplicate the block/owner relation rows.

Here’s a look at the performance gains when creating a draft for an entry with 100 blocks and 10 sites:

Three bar charts showing the performance gains that this PR introduces. See the table below for the raw data

Before After
Time 31.27s 2.08s
Queries 13,193 263
Memory 114MB 49MB

Similarly, when applying a draft, we no longer need to re-save any blocks that were never touched for the draft. However the improvement isn’t quite as stark there if versioning is enabled for the section, as we still need to duplicate all the blocks when creating the revision.

Related issues

@brandonkelly brandonkelly force-pushed the feature/dev-110-improve-matrix-save-performance branch from c61076a to 4dba6ec Compare February 16, 2022 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant