hexus / pragma

Declarative form builder
3 stars 1 forks source link

Optimise #7

Open hexus opened 5 years ago

hexus commented 5 years ago

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 commented 5 years ago

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:

hexus commented 5 years ago

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. :v:

hexus commented 5 years ago

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

hexus commented 5 years ago

Fixed lol. :tada:

hexus commented 3 years ago

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