Skip to content

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