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

Limit fm_renumber traversal to repeatables #830

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mboynes
Copy link
Contributor

@mboynes mboynes commented Mar 2, 2022

This is a performance improvement to fm_renumber. It works by limiting the fm-wrapper elements which get data-fm-array-position attributes to only those with limits != 1. In JS, only.fm-element[data-fm-array-position] elements are traversed. Using a sample group with deep nesting, DOM traversal dropped from thousands of elements to dozens and performance improved about as one would expect.

To be clear, this isn't an end-all-be-all fix. DOM traversal in this function is still a problem, and it's still very possible to generate a nesting of groups and fields that blocks the event loop for multiple seconds on sorting, but this should solve 99.9% of real world use cases. Further refinement should be weighed by its opportunity costs, since that time could be better spent on a deeper overhaul using React or VueJS.

Refs #829

Copy link
Contributor

@mogmarsh mogmarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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.

2 participants