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

Smarter reordering algorithm #36

Open
L3P3 opened this issue Aug 1, 2021 · 1 comment
Open

Smarter reordering algorithm #36

L3P3 opened this issue Aug 1, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@L3P3
Copy link
Owner

L3P3 commented Aug 1, 2021

IS

Currently, node_map items are ordered by reinserting them when their index (absolute position) has changed.
Currently, node_map items are ordered by reinserting all of them.
Currently, node_map items are ordered by reinserting all of them if their nextSibling changes.

SHOULD

Just reinsert them if their relative position has changed!
Try to reinsert as fewest as possible without getting too complicated.

Note

In practice, it works well enough. But as shown by benchmark, this makes lui one of the slowest candidates for "remove row", since all n rows get reinserted without any need. It just looks bad in the table!

@L3P3 L3P3 added the enhancement New feature or request label Aug 1, 2021
@L3P3 L3P3 self-assigned this Aug 1, 2021
L3P3 added a commit that referenced this issue Aug 29, 2021
@L3P3
Copy link
Owner Author

L3P3 commented Aug 29, 2021

The index-based method was pretty stable in most cases but in some rare cases, the reordering would have been incorrect, so I went for a temporary and much less efficient solution: Reinserting all items on each rerender.

L3P3 added a commit that referenced this issue Mar 29, 2022
L3P3 added a commit that referenced this issue Mar 29, 2022
L3P3 added a commit that referenced this issue Mar 29, 2022
@L3P3 L3P3 added enhancement New feature or request and removed enhancement New feature or request labels Dec 26, 2023
@L3P3 L3P3 removed their assignment Dec 26, 2023
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