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

Optimise #7

Open
hexus opened this issue Feb 5, 2019 · 5 comments
Open

Optimise #7

hexus opened this issue Feb 5, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@hexus
Copy link
Owner

hexus commented Feb 5, 2019

Complete updates are expensive because they update every field regardless of what's changed. This can be optimised by diffing the given data with the current form data, and only updating the leaf paths that changed.

In some situations it may be faster to only update the common ancestors that changed, but typically the form structure is fairly static.

@hexus hexus added the enhancement New feature or request label Feb 5, 2019
@hexus hexus self-assigned this Feb 5, 2019
@hexus
Copy link
Owner Author

hexus commented Feb 7, 2019

Seems like updating leaf fields is incorrect: some may not exist due to template field processing.

So we need to do one of the following:

  • Visit every node still, but ensure no field is updated more than once
  • Update the nearest existing common ancestors of all updated paths

hexus added a commit that referenced this issue Feb 8, 2019
Attempts to prevent fields from being updated more than once. WIP.
hexus added a commit that referenced this issue Feb 9, 2019
@hexus
Copy link
Owner Author

hexus commented Feb 10, 2019

That'll do for now.

Full updates only occur if the state property is a different object.

Updates are now fully reliant on updatePath(), which performs a sub-tree update traversal, followed by an ancestor update traversal.

Back to being snappy. ✌️

@hexus hexus closed this as completed Feb 10, 2019
@hexus
Copy link
Owner Author

hexus commented Feb 10, 2019

Actually still an issue, initial update is still revisiting way too many fields.

@hexus hexus reopened this Feb 10, 2019
hexus added a commit that referenced this issue Feb 10, 2019
Fixed this by restoring a missing visited field pass-through in updatePath().
@hexus
Copy link
Owner Author

hexus commented Feb 10, 2019

Fixed lol. 🎉

@hexus hexus closed this as completed Feb 10, 2019
@hexus hexus reopened this May 3, 2021
@hexus
Copy link
Owner Author

hexus commented May 3, 2021

Value caching is quite wrong on initial update, so this needs reworking.

hexus added a commit that referenced this issue Aug 7, 2021
Also started updating <pragma-picker>
@hexus hexus mentioned this issue Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant