Skip to content

Improve list diffing/patching performance #120

@JaggerJo

Description

@JaggerJo

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"
        ...
    ]
    ...
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions