Skip to content

Performance issueΒ #60

@mindplay-dk

Description

@mindplay-dk

I noticed that the setState callback currently updates not only the affected node, but all of it's siblings.

render(vnodes, dom), // And then we call-out to the re-render function

State updates are synchronous, so imagine you have to update 10 sibling components - each component calls setState and triggers updates of all the other component, so a total of 10*10 = 100 updates.

Since the function signature is render(vnodes, dom), it looks like there's currently no way to update an individual child node.

Likely this needs to be refactored, something like extracting a function renderNode(vnode, domParent, domChild) and calling that from the setState closure instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions