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

Proposal: archive() automatically merges all patches when autoArchive is disabled #2

Closed
unadlib opened this issue Mar 24, 2024 · 0 comments

Comments

@unadlib
Copy link
Member

unadlib commented Mar 24, 2024

When autoArchive is disabled, archive() may store a large number of temporary patches in controls.patches, which could lead to unnecessary waste of memory data size. Therefore, we can utilize the Mutative apply() to merge them into as small a patch data as possible, without altering the final outcome.

For example,

Two inversePatches:

[
  [{"op":"replace","path":[],"value":3}],
  [{"op":"replace","path":[],"value":4}]
]

They will be merged into:

[
  [{"op":"replace","path":[],"value":3}]
]
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

No branches or pull requests

1 participant