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

Improve list diffing/patching performance #120

Open
JaggerJo opened this issue May 3, 2020 · 0 comments
Open

Improve list diffing/patching performance #120

JaggerJo opened this issue May 3, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@JaggerJo
Copy link
Member

JaggerJo commented May 3, 2020

FuncUI currently implements super simple list diffing that works just fine in most cases.

There are cases where a list contains complex or a lot of different items this can be problematic. Especially when items are inserted at index 1 - because this currently will result in rebuilding all items.

Implementing a 2nd list diffing strategy that utilises keys to reduce the required patch work could speed up list diffing by a lot. (here is how react does it)

Adding a Key to Avalonia Controls is easily possible using AttachedProperties. (We actually implicitly attache properties to controls for internal subscription handling - IIRC)

StackPanel.children [
    TextBlock.create [
        TextBlock.key "item 1"
        TextBlock.text "item 1"
        ...
    ]
    ...
]
@JaggerJo JaggerJo added the enhancement New feature or request label May 3, 2020
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